✓ Accepted answer
Okay so what you have laid out is spawning players on a random map. Maybe make an intermission period. This will be really basic.
while true do
wait(30)
maps = game.ServerStorage.Maps:GetChildren()
map = maps[math.random(1, #maps)]
map:Clone().Parent = game.Workspace
for _,player in pairs(game.Players:GetPlayers()) do
if player.Character then
spawns = map.Spawns:GetChildren()
player.Character:MoveTo(spawns[math.random(1, #spawns)].Position)
end
end
wait(300)
for i,player in pairs(game.Players:GetPlayers()) do
if player.Character then
player.Character.Head:remove()
end
end
end
that is a basic game script but you mentioned teams correct?
while true do
wait(30)
maps = game.ServerStorage.Maps:GetChildren()
map = maps[math.random(1, #maps)]
map:Clone().Parent = game.Workspace
blue = 0
red = 0
local teamplay = game.Players.GetChildren()
for i = 1,game.Players.NumPlayers do
local ran = math.random(1,game.Players.NumPlayers)
if blue == red then
br = math.random(1,2)
if br == 1 then
teamplay[ran].TeamColor = BrickColor.new("Bright blue")
elseif br == 2 then
teamplay[ran].TeamColor = BrickColor.new("Bright red")
end
elseif red >= blue then
teamplay[ran].TeamColor = BrickColor.new("Bright red")
elseif blue >= red then
teamplay[ran].TeamColor = BrickColor.new("Bright blue")
end
end
for _,player in pairs(game.Players:GetPlayers()) do
if player.Character then
spawns = map.Spawns:GetChildren()
player.Character:MoveTo(spawns[math.random(1, #spawns)].Position)
end
end
wait(300)
for i,player in pairs(game.Players:GetPlayers()) do
if player.Character then
player.Character.Head:remove()
player.TeamColor = BrickColor.new("White")
end
end
end
Just create 3 teams. One Bright blue, One Bright red, and another White. Spawns are still random but if you want to create seperate spawns, I'm sure you can do it (;
7 comments
What would be white, lobby??
With line 30, I can change it to600 so its 10 mins per round?? I want it to be on a GUI countdown,will that be possible??
And at the top with intermission, I have already a count down in GUI, and set it to change a BoolValue to True once the countdown has finished. Can I just do if game.Workspace.BoolValue.Value = true then, will that work??
Do the spawns in the map have to be spawnlocations or can they just be blocks?
It didnt work, what do I need to add to it, what should the maps be called, what should the spawns be called, etc tec
I have fixed it, and the maps load, but you dont tp to the teams. What do I have to add??
Do you have a team service with teams that are {"Bright blue","Bright red","White"}? and yes White would be intermission. The question about the intermission you can totally just do while game.Workspace.BoolValue.value == true then.