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 change 1 random player to another team?

Hello I Speak Spanish... And I need ¿How to move from one team to another through a script?

of 13 players on a team called "Human" I want to pass 1 player to a team called "Predator"

How do I pass 1 random player to the "Predator" team?

and for example the game lasts 180 seconds or 3 minutes

Once the 3 minutes are finished

after that player who was "Predator" who returns to the "Human" team

Please Help !

``

while true do

local tiempo = 60
local h = Instance.new("Hint")
h.Parent = game.Workspace
h.Text = "Descanso "..tiempo.." Segundos restantes"
for i = tiempo, 1, -1 do
wait(1)
h.Text = "Descanso "..i.." Segundos restantes"
end
wait(1)
h.Text = "Cargando mapa..."
wait (6)
h.Text = "Mapa Cargado"
wait (2)
----------------------	
local player = game.Players:GetPlayers()
for i = 1, #player do
player[i].Character:MoveTo(Vector3.new(130, 9633.5, -1245))
end

-----------------------------------
h.Text = "Eligiendo el Depredador..."

function equipo_seleccion()
	-- Script of team change here --		
	
	-- ???????????????????????
	
end	

1 answer

✓ Accepted answer

Here is a way to do it.

local plrs = game.Players:GetPlayers()
local predator = plrs[math.random(1,#plrs)]

1 comment

0

¡¡¡¡Gracias!!!!

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