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

SpawnLocation Bug, Help?

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago

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.

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

Answer this question