Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

im trying to make a axe that hits a tree, how do I fix?

Asked by 6 years ago
local plr = script.Parent.Parent.Parent

script.Parent.Handle.Touched:Connect(function(hit)

if script.Parent.CanHit.Value == true then
if hit.Parent.Name == "Tree" then
script.Parent.CanHit.Value = false

hit.Parent.Properties.Health = hit.Parent.Properties.Health - script.Parent.Properties.Damage.Value

if hit.Properties.Health == 0 then
    game.ServerStorage.Data["Folder" .. plr.Name].woodAmount = game.ServerStorage.Data["Folder" .. plr.Name].woodAmount + hit.Parent.WoodPrice.Value
end

end

end
end)

that's the code inside the tool, know what I did wrong?

0
any errors? Warfaresh0t 414 — 6y

Answer this question