So I want to make it so that when you click a part it gives you plus 1 win. The leaderstats are already set up and I know how to use clickdetectors. I just need to know how to use it to change a leaderstat value(leaderstat is in player btw).
✓ ANSWER ACCEPTED
How to change a leaderstats value?
1 answer
✓ Accepted answer
script.Parent.ClickDetector.MouseClick:Connect(function(plr) -- This gets the player that just clicked on the part
local Wins = plr:WaitForChild("leaderstats"):WaitForChild("Wins")
Wins.Value = Wins.Value + 1 -- Increment the value of Wins by 1 (or whatever you are incrementing by)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thanks for the help!
No problem!