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

¿How do I change 1 random player to another team?

Asked by 7 years ago

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

Log in to vote
0
Answered by 7 years ago

Here is a way to do it.

local plrs = game.Players:GetPlayers()
local predator = plrs[math.random(1,#plrs)]
0
¡¡¡¡Gracias!!!! proPVPgamers_YT 40 — 7y
Ad

Answer this question