I am trying to make a system where a player can punch trees to gain resources and I can’t seem to get it to work. I’ve tried using a humanoid in the tree model but for some reason it doesn’t work and I tried having an IntValue as the trees health but that didn’t work either
Any support would be appreciated!
Do you have any current code you would like us to check over?
clickDetector.MouseClick:Connect(function(plr) --Detect when someone clicks the tree
tree.Health.Value -= 1 --IntValue representing health
plr.Wood.Value += 1 --Add the resources to the player's inventory (Change to your inventory system)
if tree.Health.Value == 0 then tree:Destroy() end --Check if the tree has no health left then destroy if it does
end)
I don’t fully understand your issue, is it the animation? or is resources not coming up? or is it something else
What’s the issue? Also can we see the script?