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

How to fix this error, Didn't had it until restarted?

Asked by 2 years ago

Hi, so i got this error and idk what the hell is going on since i never had this error

error: ServerScriptService.leaderstats:84: attempt to index nil with 'UserId'

game:BindToClose(function(player)
    for _, Player in pairs(game.Players:GetPlayers()) do
        local playerUserId = "player_"..player.UserId
0
Use Player.UserId since you never identified “player” T3_MasterGamer 2189 — 2y

1 answer

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
2 years ago

Instead of

local playerUserId = "player_"..player.UserId

do

local playerUserId = "player_"..Player.UserId
Ad

Answer this question