Advertisement
creavin

chopp a tree

May 26th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. hits = script.Parent.hits.Value
  2. hitsneeded = script.Parent.Hitsneeded.Value
  3. function OnTouch(hit)
  4. if hit.Parent.Name == "axe" then
  5. hits = hits + 1
  6. end
  7. if hits > hitsneeded then
  8. script.Parent.CanCollide = false
  9. script.Parent.Transparency = 1
  10. end
  11. end
  12.  
  13. script.Parent.Touched:connect(OnTouch) --- put in trunk and make a leaf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement