I have made a leaderboard and I want its value to go up every time a block is pressed.
✓ ANSWER ACCEPTED
Whats the script for values to go up when something is touched?
2 answers
✓ Accepted answer
Try anything like this in the block that will be touched:
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
game.Players.LocalPlayer.leaderstat.Status.Value = 2
wait(0.003)
script.Parent:Destroy()
end
end
script.Parent.Touched:connect(onTouch)
You need to change leaderstat.Status for your "Value Name"
Did you not read the community guidelines, it clearly says not to just ask for people to make you scripts
1 comment
0
Sorry
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
What if its value needs to go up in a leaderboard?
Just remove the = and put + .... Example: game.Players.LocalPlayer.leaderstat.Status.Value + 2