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

Lobby - is there a way to still let current players respawn in their game?

Asked by 6 years ago

I have created a game for 6 players that allows a player to rejoin the game on death but they will just have to start back at the original spawn location and restart the "race" from there. I have all of that implemented, but now I am looking to make it so that the game will wait for at least 4 players before it starts. It looked like a lobby was the answer, but it appears with a lobby - players in the current game cannot re-spawn within their game but only back in the lobby - is that correct? Is there some work around or a different type of solution I should be looking at?
Thanks!

0
No, it is still possible for players to respawn within their game. Just make a bunch of bricks and bring the players to those bricks that are not in the lobby. Be sure to not get confused about teleportation (Torso for R6, HumanoidRootPart for R15). DeceptiveCaster 3761 — 6y
0
But R6 has a HumanoidRootPart too. jackfrost178 242 — 6y
0
I think R6 has HumanoidRootPart. HumanoidRootPart should be used for teleportation. Dog2puppy 168 — 6y
0
Torso is used for R6. DeceptiveCaster 3761 — 6y
View all comments (5 more)
0
Watch that attitude, and yes, R6 straight up has a HumanoidRootPart. Go look right now. jackfrost178 242 — 6y
0
ohh... DeceptiveCaster 3761 — 6y
0
I still use Torso. DeceptiveCaster 3761 — 6y
0
No hard feelings. Though i would recommend using the root part so your scripts are more flexible. jackfrost178 242 — 6y
0
Sorry - got a little confused on the back and forth here- could you just clarify this a bit? phdmysteries 2 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Uhhh, don't entirely understand the problem, but here is some code that waits until there are 4 people in the game before running the if statement. It will check again after the if statement runs. Hopefully this helps :)

--put in ServerScriptService
while wait() do
    if game:GetService("Players").NumPlayers >= 4 then
        --Your code here :)
    else
    end
end
Ad

Answer this question