I have a script that detects when you left click only while holding a specific tool but i need it to change the int value of a leader board stat every time you click
Here is my script so far
local Tool = script.Parent --make sure this is a Tool object Tool.Equipped:connect(function(Mouse) Mouse.Button1Down:connect(function() end) end)
Any help would be appreciated :P
Just like you referenced your tool variable. Create a reference to your IntValue object.
For example if you had your leaderstats parent as the player and you had an IntValue object with the name (identifier) as "experience" with it's parent being leaderstats. You could use something like this.
local player = game.Players.LocalPlayer local leaderstats = player:FindFirstChild("leaderstats") local experience = leaderstats.experience