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

How to dictate where you will spawn?

Asked by
CjInc 5
8 years ago

We all know "the longest obby in roblox," right? How all the spawn locations are the same color, and you still spawn at the correct obstacle? Well, I'm trying to do the same thing, yet cannot figure out how. If I have multiple spawn locations of the same color, there's no telling which you'll spawn at.

How can I make it easier on myself by keeping all spawns the same color for an obby, yet still have the player spawn at the correct obstacle?

ANY help is much appreciated! Thanks! :)

ALSO, how would I tell what stage a player is on? Instead of having all the players grouped into a "team," possibly having the stage name or number next to their name?

2 answers

Log in to vote
0
Answered by
RedCombee 585 Moderation Voter
8 years ago

There are several ways to do this.

First, you can name your spawns: (This is logic, not Lua syntax)

player.CharacterAdded:connect(function(character) -- Every time the character spawns
    character:MoveTo("Spawn"..level the character is on) -- Move to the corresponding spawn
end)

I find this the best method to use, but if you don't like it, you can try to come up with your own.

0
Thank you for your help. I'll take this into consideration CjInc 5 — 8y
0
False. 0xDEADC0DE 310 — 8y
Ad
Log in to vote
1
Answered by 8 years ago

Players have a property called RespawnLocation. A Player's RespawnLocation, coincidentally, must be a SpawnLocation instance. To set this, just do...

local spawn = Instance.new("SpawnLocation", workspace)

game.Players.LocalPlayer.RespawnLocation = spawn

Answer this question