trying to make a tree fall over and come back after its chopped down it works if i delete a certain wait() but if i include it it stops working! any solutions?
script.Parent.Triggered:Connect(function(Player, plr)
local trunk = script.Parent.Parent
local logclo = game.ServerStorage.Log:Clone()
logclo.Parent = Player.Backpack
local originPos = trunk.Position
local originOri = trunk.Orientation
print(originOri, originPos)
trunk.Anchored = false
wait(0.1)
trunk:ApplyImpulse(Vector3.new(x,y,300))
trunk.ProximityPrompt.Enabled = false
wait(2)
print("bye bye tree")
trunk.Transparency = 1
trunk.CanCollide = false
wait(5) -- gets to here and breaks
print("Reloading tree")
trunk.CanCollide = true
trunk.Orientation = originOri
trunk.Position = originPos
trunk.Anchored = true
trunk.Transparency = 0
trunk.ProximityPrompt.Enabled = true
print(trunk.Orientation, trunk.Position)
end)
Here is my code. Any help appreciated