#Randomised Team Spawning

1 messages · Page 1 of 1 (latest)

wary flare
#

new to scripting i'm trying to get all players from one point (lobby ) to another (arena) with equal (or near equal) teams, but i have no idea of how i could get that to work. I used math.random to get he random arena location, but i can't figure out how i can get the teams equal. does anyone have any ideas?

silent flickerBOT
#

studio** You are now Level 3! **studio

twilit siren
#

so when its the first player its false and it assigns them to team 1

#

then it flips to true

#

and thus it assigns the next player to team 2 and flips to false

#

repeat for all players

#

idk if thats the best way but it worked for me

wary flare
#

did u use a localscript or normal script??

twilit siren
#

normal script

wary flare
#

serverscriptservice?

twilit siren
#

yes

wary flare
#

howd u make an individual player as a variable

twilit siren
#

players:GetPlayers()
then loop it

#

for i, player in playertable do

wary flare
#

im so confused

#
local indiv = false

for _, player in pairs(game.Players:GetPlayers()) do
    local char = player.Character
if indiv == false then
    char.HumanoidRootPart.CFrame = Arena.CFrame
    indiv = true
else
    char.HumanoidRootPart.CFrame = Arena2.CFrame
end```
#

am i anywhere near close

twilit siren
#

set indiv to false at the other teleport

wary flare
#

oh fr??

#

is that it

twilit siren
#

works fine for me