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 |