I tried this in a script but I couldn't find a leaderboard object so I created one along with the code to add money but then when i tested it it didn't work can someone help
local brick = script.Parent
function onTouched(hit)
for i,player in ipairs(game.Players:GetPlayers()) do
if player.Character then
local stat = player:FindFirstChild("leaderstats")
if stat then
player.leaderstats.Money.Value = player.leaderstats.Money.Value +1
brick:Destroy()
end
end
end
end
brick.Touched:connect(onTouched)
btw sorry for possible confusion first question

2 comments
Where do you create the leader stats?
I'm assuming he didn't create a leaderstat folder inside the player when they joined, otherwise this would've worked.