And this is the line: player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + reward
Even tho I have wrote it as “Cash” it still gives me an error sometimes that it’s called bucks.
local player = game:GetService("Players").LocalPlayer
player.leaderstats:WaitForChild("Cash").Value = player.leaderstats:WaitForChild("Cash").Value + reward
Possibly try to make it so the leaderstats load first so something like this, i don’t know if this would change anything though.
local player = game:GetService("Players").LocalPlayer
player:WaitForChild("leaderstats").Cash.Value = player:WaitForChild("leaderstats").Cash.Value + reward