I’m trying to make the players tool damage is based on players leaderstat. But every time the damage value change, The damage stays the same.
-tool.Equipped:Connect(function()
local chr = tool.Parent
local plr = game.Players:FindFirstChild(chr.Name)
local dmg = plr.Rescources.damage.Value
print(dmg)
...
I have a button that gives the player a tool and changes the damage leaderstat to 10. But every time it prints the dmg, it stays 0.
I am trying to damage the player but when I equip the tool, Instead of printing ‘10’ (damage value) it prints ‘0’ (in the leaderstat script, the damage is set to 0). Like the tool script doesn’t detect that the damage leaderstat value has changed.
I am using a Local script for my button and It fires a remote event. It works fine. The only thing that works in the tool script is the animation not the damage.