Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I make a tool that changes a leaderstat when used?

So I've wanted to make a tool that when clicked while holding it, a leaderstat would change, how would I exactly do this?

1 answer

✓ Accepted answer

Make a localscript in the tool and you could use this script:

local Tool = script.Parent

local Player = game.Players.LocalPlayer
local Leaderstats = Player:WaitForChild("leaderstats")

Tool.Equipped:connect(function()
Tool.Activated:connect(function()
Leaderstats.SomeStringValue.Value = SomeValue
end)
end)

1 comment

0

Also how would I make it so let's say if a certain stat is a certain value(Ex. 2), it then does a different value then a set value in that local script?

This discussion is preserved as it was. New answers, comments, and votes are closed.