I am trying to make a script that adds money every 60 seconds of you playing the game to a leaderstat I already created, but it doesn't seem to work at all, all I saw was this error: attempt to index nil with 'FindFirstChildWhichIsA', any fixes? There doesn't seem to be any syntax errors in my code. Heres a code snippet.
local stats = game.Players.LocalPlayer:FindFirstChildWhichIsA("Folder")
while true do
wait(60)
if stats.Name == "leaderstats" then
stats.Money.Value = stats.Money.Value + 50
print("Gave"..game.Players.LocalPlayer.Name" money!")
else
print("Couldn't find leaderstats folder in "..game.Players.LocalPlayer.Name)
end
end
