Found it in chapter 3 of the scripting book, The script is placed inside a part and summons it to the players position constantly.
function onPlayerEntered(player)
player.CharacterAdded:connect(function(char) --Anonymous function fired when player's character loads
while wait() do -- Infinite loop!
script.Parent.CFrame = CFrame.new(char.Torso.Position) -- Tele to player's position
end
end)
end
game.Players.PlayerAdded:connect(onPlayerEntered) -- connects function to PlayerAdded event.
What I don't understand is
function onPlayerEntered(player)
player.CharacterAdded:connect(function(char)
Shouldn't player.CharacterAdded:connect(function(char) return nil since player isn't defined?

1 comment
“player” would be defined though, as “player” is the player that joined the game. Plus you would be getting an error if “player” is nil.