I have a regen button. It works fine :) But I want the button to turn black to mark how long until it shows when it can regen. here is the code.
local model = game.Workspace.Giant
local message = Instance.new("Message")
message.Text = "Regenerating "..model.Name
local backup = model:clone()
local regenerating = false
function regenerate()
--Don't regenerate again if we're already doing it!
if regenerating then
return
else
regenerating = true
end
model:Destroy()
-- Display the regen message for 4 seconds
message.Parent = game.Workspace
wait(4)
message.Parent = nil
-- Put the copied model back into workspace
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
-- After 30 seconds, allow the model to be regenerated again
wait(150)
regenerating = false
end
--Connect a function that regenerates the model when a player touches the button NEED UR HELP!
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
regenerate()
end
end)
Help respected
