Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local box = script.Parent
- local debounce = false
- local everything = {model}
- local names = {model}
- local children = game.Workspace.Cars:children()
- for i=1,#children do
- if (children[i].Name == "Humanoid") then
- table.insert(everything, children[i]:clone())
- table.insert(names, children[i].Name)
- end
- end
- function regen()
- for i=1,#everything do
- new_thing = everything[i]:clone()
- new_thing.Parent = game.Workspace.Cars
- new_thing:makeJoints()
- end
- end
- function onTouched(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid") -- OK were done!
- if humanoid~=nil and debounce == false then
- debounce = true
- script.Parent.BrickColor = BrickColor.new(21)
- game.Workspace.Valuen.Value = game.Workspace.Valuen.Value +1
- regen()
- wait(5)
- script.Parent.BrickColor = BrickColor.new(28)
- debounce = false
- end
- end
- script.Parent.Touched:connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement