What do you want to achieve? When my axe chops a tree, I want it so that it can be collected when Anchored = false
What solutions have you tried so far? I have looked tutorials on how to chop trees but none of them said how the tree can be collected after you touch it.
My current code for chopping the tree
local z = script.Parent
local x = z.Log
local y = z.Leaves
local hits = 0
local hitsN = 3
x.Touched:connect(function(hit)
if hit.Parent.Name == "Axe" then
hits = hits + 1
if hits == hitsN then
hits = 0
x.Anchored = false
y.Anchored = false
y.CanCollide = false
wait(3)
hit:Destroy()
x.Rotation = Vector3.new(45,0,0)
end
end
end)
I have another issue. When I chop my tree, my axe disappears and is no longer able to be used. How do I make it so that it’s usable all the time?
Well what about using a touched event, or a click event, maybe that can be used for collecting an item (I recommend a clicked event)
Also in the script you’re saying hit.Destroy() with the axe being parented to hit.Parent