local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Value = 0
local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(newPlayer.Name)
if cashmoney ~= nil then
cashmoney.Changed:connect(function()
cash.Value = cashmoney.Value
end)
end
This is my script for having a leaderboard with cash on it, and it starts with 0, and also its a tycoon game. How do i make it so that if any player touches a certain part, somewhere in the middle of the map, it adds cash to their leaderboard?

4 comments
do you mean just to add to the cash value? like cash.Value = cash.Value + 1
No because then I'm petty sure that would change the cash amount of a player when they just join. I need it to add on later, fro
just put it under a touch function and add it to the player who touched the brick.
Yup that's exactly what I did, thank you.