I am currently making a adventure game, and I want a way to get some quick cash to be to going up to a randomly spawning banknote and using the proximity prompt that comes up to interact with it. When you interact with it, I want it to get a random number between 1 and 1000 and store it in a variable (which I already know how to do). Then I want to increase the amount of cash the player has in the leaderboard by whatever number they get, which I also know how to do. The thing is I don’t know how to get it to actually connect to the leaderboard to add the extra cash. I’ve tried this before in some random game I was making, but it didn’t work and I couldn’t be bothered to get help. But now I am making an actual proper game that requires it and now I need help. So if you could help me thanks.
local banknote = script.Parent
banknote.ProximityPrompt.Triggered:Connect(function(player)
-- Run your code ( leaderstats value = leaderstats value + number )
end)