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

Whats the script for values to go up when something is touched?

I have made a leaderboard and I want its value to go up every time a block is pressed.

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"

2 comments

0

What if its value needs to go up in a leaderboard?

0

Just remove the = and put + .... Example: game.Players.LocalPlayer.leaderstat.Status.Value + 2

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.