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

How can I add damage to a tool using the player's leaderstats?

Asked by 2 years ago
Edited 2 years ago

i'm not sure how to add it into the script. (not a local script)

i tried using local damage = game:GetService("Players").LocalPlayer.leaderstats.Damage.Value but it doesn't wotk

Tool.Activated:Connect(function(p) if p.Parent:FindFirstChild("Humanoid") and p.Parent ~= Tool.Parent then if Debounce == false then Debounce = true print(dmg) wait(0.01) local Humanoid = Tool.Parent:WaitForChild("Humanoid") local AnimTrack = Humanoid:LoadAnimation(Slash)

        AnimTrack:Play()
        wait(.3)
        sound:Play()
        wait(0.4)
        Debounce = false
    end
end

end)

1 answer

Log in to vote
0
Answered by 2 years ago
Tool.Activated:Connect(function()
damage=game.Players[Tool.Parent.Name].leaderstats.Damage.Value
end)
0
it doesn't work. when i removed the sword base damage and left to sword damage only to game.Players[Tool.Parent.Name].leaderstats.Damage.Value it says that the damage is 0 when its printed AvocadoM678 17 — 2y
Ad

Answer this question