Regenerating parts once every 15 seconds?
Asked by
5 years ago Edited 5 years ago
I am not skilled enough to do something like this so I used someone's free model. This script regenerates parts but there is 2 things I don't like about it. One is that when you touch the block, it regenerates the part every 0.1 second until you get off it. I put a wait before "regenerate()" and it was regenerating parts every 10 seconds which is what I want. However, if the player touches the block 5 times and walks away, it'll regenerate the parts every 10 seconds until it regenerates 5 times because that's how many times the player touched it. How can I make this that once the player touches the block it regenerates all parts and then waits 10 seconds before the player can touch the block again to regenerate?
01 | model = script.Parent.Parent |
08 | model = backup:clone() |
09 | model.Parent = game.Workspace |
11 | script.Disabled = true |
13 | script.Disabled = false |
17 | if (hit.Parent:FindFirstChild( "Humanoid" ) ~ = nil ) and enabled then |
22 | script.Parent.Touched:connect(onHit) |