Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

PlayerAdded function not working?

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

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

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

2 comments

0

what if he had a variable called Players? probably not but it could happen

0

I did have a variable called "Players" that linked to game.Players.

This discussion is preserved as it was. New answers, comments, and votes are closed.