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

PlayerAdded function not working?

Asked by 4 years ago

In one of my main major scripts, my player added function isn't working, thus breaking my entire game.

It returns no error, and no matter where I move it in the script, it won't work.

Here's the code:

Players.PlayerAdded:Connect(function(player)
    print("Loaded")
    player:LoadCharacter()
end)

I even added a print before and after the function. They print, but 'Loaded' doesn't show in the output as well.

Help?

1 answer

Log in to vote
0
Answered by
3wdo 198
4 years ago

its pretty simple. you forgot game.Players so it would be

game.Players.PlayerAdded:Connect(function(player)
    print("Loaded")
    player:LoadCharacter()
end)
0
what if he had a variable called Players? probably not but it could happen Kriscross102 118 — 4y
0
I did have a variable called "Players" that linked to game.Players. FireyMcBlox 134 — 4y
Ad

Answer this question