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

How do I move players off the "Playing" team when they die in a round?

So my game in development has two teams: "Playing" for the people currently in a round, and "Lobby" for the people in the lobby. What's the best way to make a script that moves a player off the "Playing" team when they die during a round, and where do the script(s) go? I know how to move all players to one team, I'm just a bit unsure about moving specific players to the lobby team when they die. Thanks

2 comments

0

You could try add a boolean inside the player, to check if they are playing the game? if they died, and bool is true, then that means they were in the round, then you can make the changing teams.

0

Hm, would I put the script inside StarterPlayerScripts?

1 answer

✓ Accepted answer

You can put the bool inside your intermission script. if you have a player variable, add a new instance "BoolValue" (parent is the player) and set it to true, when you teleport them to the arena/place. (originally false). You can check if a player has died, and when they do, just set their bool value to false.

local bool = Instance.new("BoolValue", player)

player.Character.Humanoid.Died:Connect(function()
	if bool then -- if bool is true
		-- send them to the lobby
	else
		-- dont do anything
	end
end)

1 comment

0

I see, this is actually very similar to what I did and I'm just wondering if this will work with changing their team aswell as teleporting them to the lobby once the player has died?

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