I Am Trying To Make A Car That When You Press The Respawn Button It Keeps The Car And Respawns It. Currently I Am Struggling With The Button Respawning
model = script.Parent.Parent
messageText = ""re.
message = Instance.new("Message")
message.Text = messageText
backup = model:clone()
enabled = true
function regenerate()
wait(3)
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
message.Parent = nil
script.Disabled = true
script.Parent.BrickColor = BrickColor.new(26)--Black
wait(5)
script.Parent.BrickColor = BrickColor.new(104)--Purple
script.Disabled = false
end
function onHit(hit)
if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then
regenerate()
end
end
script.Parent.Touched:connect(onHit)
