Advertisement
Tacidus

Chop-able Tree

Jul 28th, 2020
7,443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local Log = script.Parent.Log
  2. local Leaves = script.Parent.Leaves
  3. local hits = 0
  4. local totalhits = 5
  5. local SpareTree = game.ReplicatedStorage.Tree
  6.  
  7. Log.Touched:Connect(function(hit)
  8.     if hit.Parent.Name == "Axe" then
  9.         hits = hits + 1
  10.        
  11.         if hits == totalhits then
  12.             hits = 0
  13.             Log.Anchored = false
  14.             Leaves.Anchored = false
  15.             Leaves.CanCollide = false
  16.             wait()
  17.             Log.Rotation = Vector3.new(45,0,0)
  18.             wait(3)
  19.             Log:Destroy()
  20.             local NewTree = SpareTree:Clone()
  21.             NewTree.Parent = workspace
  22.         end
  23.     end
  24. end)
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement