REGENERATION BUTTON
Insert a Brick and name it "Button" Place this script insinde the button:
model = game.Workspace.MyModelName -----Change this to model name
messageText = "Regenerating MyModelName..." ----Change this to the text U see
message = Instance.new("Message")
message.Text = messageText
backup = model:clone()
enabled = true
function regenerate()
message.Parent = game.Workspace
model:remove()
wait(4) -- display regen message for 4 seconds
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
message.Parent = nil
enabled = false
wait(30)
enabled = true
end
function onHit(hit)
if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then
regenerate()
end
end
script.Parent.Touched:connect(onHit)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THIS SCRIPT IS IF U WANT THE THING THAT UR REGENERATING TO DISSAPEAR BEFORE IT REGENS
Regen auto:
model = game.Workspace.MyModelName ---change this to model name
messageText = "Regenerating MyModelName..." ---the message
message = Instance.new("Message")
message.Text = messageText
backup = model:clone()
while true do
wait(300) -- regenerate this model every 300 seconds --interval time
message.Parent = game.Workspace
model:remove()
wait(4) -- display regen message for 4 seconds
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
message.Parent = nil
end |