Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Put this script in your button and put your button in the same model as your vehicle
- model = script.Parent.Parent--Indicates that the script interacts with the model the button is grouped with.
- backup = model:clone()
- enabled = true
- function regenerate()
- model:remove()
- wait(3)--
- model = backup:clone()
- model.Parent = game.Workspace
- model:makeJoints()
- script.Disabled = true
- script.Parent.BrickColor = BrickColor.new(26)--Black
- wait(3)--Change this number to change the time in between regenerations via the button, in seconds..
- 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement