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

How can I touch a brick and make myself gain money? (Leaderboard IntValue)

I don't understand how you would make it affect the player who touched the brick. Would you type the script as if it changes for everyone except make it a local script? Please help.

1 answer

✓ Accepted answer
function Touched(Plr)
if game.Players[Plr.Parent.Name]~=nil then
game.Players[Plr.Parent.Name].leaderstats.money.value=game.Players[Plr.Parent.Name].leaderstats.money.value+5 ---Change '5' to whatever amount you want the player to gain.
end

script.Parent.Touched:connect(Touched)

This discussion is preserved as it was. New answers, comments, and votes are closed.