Advertisement
Guest User

Owner Regen Only

a guest
Jul 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. model = script.Parent.Parent--Indicates that the script interacts with the model the button is grouped with.
  2.  
  3.  
  4.  
  5.  
  6. backup = model:clone()
  7. enabled = true
  8.  
  9.  
  10. function regenerate()
  11. model:remove()
  12.  
  13.  
  14. wait(1)--
  15.  
  16.  
  17. model = backup:clone()
  18. model.Parent = game.Workspace
  19. model:makeJoints()
  20.  
  21.  
  22. script.Disabled = true
  23. script.Parent.BrickColor = BrickColor.new(26)--Black
  24. wait(1)--Change this number to change the time in between regenerations via the button, in seconds..
  25. script.Parent.BrickColor = BrickColor.new(104)--Purple
  26. script.Disabled = false
  27. end
  28.  
  29.  
  30.  
  31. function onHit(hit)
  32. if hit.Parent:FindFirstChild("Humanoid")then if game.Players:GetPlayerFromCharacter(hit.Parent) == script.Parent.Parent.Parent.Parent.Owner.Value and enabled then
  33. regenerate()
  34. end
  35. end
  36.  
  37.  
  38.  
  39.  
  40. script.Parent.Touched:connect(onHit)
  41.  
  42.  
  43. --Remember To read EVERYTHING on this button that includes the top >_> Edit it only for Pros.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement