Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This script won't run when a player enters the server. Help?

Asked by
Discern 1007 Moderation Voter
9 years ago

The script won't run because of this output error, I assume. Can anyone help me fix it?

game.Players.PlayerAdded:connect(function(player)
    player:WaitForChild("leaderstats")
    player.leaderstats:WaitForChild("Cash")
    player.leaderstats.Cash.Value = 100
end)

My output error message:

16:45:46.871 - WaitForChild is not a valid member of Player

16:45:46.871 - Script 'ServerScriptService.CashGiver', Line 2

16:45:46.872 - Stack End

Answer this question