Guest User

Untitled

a guest
May 23rd, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. hits = script.Parent.hit
  2. newresource = script.Parent:clone() --clone yay
  3.  
  4. while true do --infinite loop
  5. if hits.Value < 1 then --if the tree has less than 1 "hp" then
  6.     wait(3) --wait a while
  7.     script.Parent:remove() --remove the tree
  8.     wait(14) --wait a while
  9.     newresource.Parent = game.Workspace --insert a new tree
  10.     newresource:MakeJoints() --make tree unable to fall over
  11. end
  12. wait(1) --wait a while before checking trees hp again
  13. end
  14.  
  15. --it says the error is on line 7, apparently "Parent" is nil
Add Comment
Please, Sign In to add comment