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

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

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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)
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? K1ng_Phant0m 13 — 6y
Ad

Answer this question