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

How to fix PlayerAdded not firing?

Asked by
Meqolo 78
6 years ago

A simple PlayerAdded script won't fire in a LocalScript or a script

Code:

game.Players.PlayerAdded:Connect(function(Plr)
    Plr.CharacterAdded:Connect(function(Char)
        print("test")
    end)
end)
0
It will fire. Are you sure the script is running? User#5423 17 — 6y
0
The script runs, if you put a print before PlayerAdded then it will print that, but not putting one after PlayerAdded Meqolo 78 — 6y
0
Uhm... The script looks perfectly fine. It will fire "test" once the Player's character has loaded. Shouldn't be any reason for it not to fire/print. Shawnyg 4330 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

If you're trying to wait for a character you can do:

game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character
print("test")
end)
0
The method he used to wait for a Player's character was proper. Shawnyg 4330 — 6y
0
Also, use "player.CharacterAdded:Wait()" hiimgoodpack 2009 — 6y
Ad
Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago

PlayerAdded most likely will not fire for the LocalPlayer in testing, but will for everyone else.

Answer this question