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

SpawnLocation Bug, Help?

I have a problem where I have 10 spawn locations far away from position 0,0,0 and instead, when I join the game, my screen goes black and I spawn at position 0,0,0. I configured all of the spawns correctly and it still bugs out. Any help?

1 answer

Are you moving the character when the player enters or the character has loaded?

The character loads a bit after the player enters the game so wait for the character loaded event to fire.

--Note: this event fires from the player object, so best have that ready
function spawn(character) --Parameter: <Model> Character
	character:MoveTo(<Vector3> Spawnpoint) --Replace with your spawn vector3
end

game.Players.<Player>.CharacterAdded:connect(spawn) --Passes character object to spawn(character)

This should work, you should probably put a script inside each player object as you need an event handler per player.

1 comment

0

Yeah so in game.Players., should be the player object you want to get character from (w/o the <> ofc). And just replace Spawnpoint with Vector3.new(x,y,z) or something.

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