local player = game.Players.LocalPlayer
repeat wait()
until player:FindFirstChild("leaderstats").Money.Value >= 7000000
if player:FindFirstChild("leaderstats").Money.Value >= 7000000 then
local m = Instance.new("Message")
m.Text = "Stats Have Been Reset"
m.Parent = player.PlayerGui
wait(5)
m:Destroy()
player:FindFirstChild("leaderstats").Money.Value = 0
script.Disabled = true
end
i want this script to reset money if players money is higher then 7 million but this script will now reset players money. please help. this is a local script in playergui. there is a leaderboard in the game which works fine. error: Players.MHaven1.PlayerGui.LocalScript:3 attempt to index a nil value.

2 comments
I think you should do repeat wait() until player:FindFirstChild("leaderstats").Money.Value >= 7000000 on one line, but I'm not sure
ok