For example, when I put a script in ReplicatedFirst and type in game:GetService("Players").LocalPlayer, does the code wait for the player to load in? I just need clarification because I tested this earlier and the code doesn't throw an error.
COMMUNITY QUESTION
Does Players().LocalPlayer wait for the player to be created if the player doesn't exist yet?
2 answers
No, that piece of code alone does not wait for the LocalPlayer, it just locates them. If you want to actually wait for the player, then do this:
local player = game.Players.LocalPlayer
local character = player.CharacterAdded:Wait()
You can also use a function
game.Players.PlayerAdded:Connect(function()
But just don't forget to put end like this at the end of the script to close the function :
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
What kinda script is this
There's no need to wait for the local player. Local scripts only run once the player has loaded in.