I was wondering how to change the value of an IntValue using a script but it isn't working. I am trying to make a currency system. Here is the code I have (new to scripting in Roblox): `local playerdata = game.Players.LocalPlayer:WaitForChild("leaderstats")
if playerdata.Coins.Value == 0 then playerdata.Coins.Value = 20000
end`
Your code should work only if the Value of Coins is 0.
@JustinWe12 The value of my coins is set to 0, and my error for anyone else is "ServerScriptService.Script:1: attempt to index nil with 'WaitForChild' - Server - Script:1"
Any other ideas?