of     1   

JarheadTech
#182421486Tuesday, January 26, 2016 2:28 AM GMT

(this was tested with two people) What the script is supposed to do: Put everyone onto teams Red and Blue, and give them swords. It is also supposed to change them back to the players team on death, and once one team is out of players they all are changed back to the players team and it restarts What is happening: Put one person on blue team, and give the person on players team a sword I am fairly new to for loops so the odds are im doing something wrong. Anyway, does anyone know what is going wrong? And if so, how can i fix it? Script: gameon = false game.Players.PlayerAdded:connect(function(startteam) startteam.TeamColor = BrickColor.new("Eggplant") end) local function setgame() local players = game.Players:GetPlayers() local teams = {BrickColor.new("Really red"), BrickColor.new("Really blue")} for key = 1, #players do table.remove(players,math.random(#players)).TeamColor = teams[key % 2 + 1] local player = table.remove(players, math.random(#players)) local tool = game.ServerStorage.ClassicSword tool:Clone().Parent = player.Backpack while gameon do wait() local bp = game.Teams.BlueTeam:GetChildren() local rp = game.Teams.RedTeam:GetChildren() if #bp == 0 then for b = 1, #bp do table.remove(bp).TeamColor = BrickColor.new("Eggplant") end gameon = false end if #rp == 0 then for r = 1, #rp do table.remove(rp).TeamColor = BrickColor.new("Eggplant") end gameon = false end end end end while true do wait() if not gameon then wait(10) local players = game.Players:GetChildren() if #players > 1 then gameon = true setgame() end end end game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) Character.Humanoid.Died:connect(function() Player.TeamColor = BrickColor.new("Eggplant") end) end) end)
SkelectroTM
#182421737Tuesday, January 26, 2016 2:32 AM GMT

Wrong sub-forum. Go to Scripters.
Key_Stone
#182422237Tuesday, January 26, 2016 2:40 AM GMT

This is the right sub - forum nub ish de squid weal
ImFarley
#182422289Tuesday, January 26, 2016 2:41 AM GMT

In theory this is the right sub-forum. In practice it is not. I also recommend Scripters. Much love -GO
JarheadTech
#182423910Tuesday, January 26, 2016 3:07 AM GMT

Scripters: This is the place for discussion about scripting. Anything about scripting that is not a help request or topic belongs here. Game Design: This is the forum to get help, talk about future ROBLOX game ideas, or gather an awesome building team. Game Marketing: This is where you show off your awesome creations, talk about how to advertise your game or share your marketing and sale tactics. Game design is the only topic for getting help.
ImFarley
#182424697Tuesday, January 26, 2016 3:19 AM GMT

I'll re-phrase. Game Design was intended for help topics of all sort, while Scripters was not. It ended up that 95% of all scripting help posts ended up in Scripters. Thus, I once again recommend Scripters. Much love -GO
JarheadTech
#182470912Wednesday, January 27, 2016 12:28 AM GMT

that makes more sense. i will post it there instead
Key_Stone
#182471809Wednesday, January 27, 2016 12:41 AM GMT

r #code print ("ish de squid weal")
tornadozebra
#182476933Wednesday, January 27, 2016 1:53 AM GMT

Its a stupid and technically broken system, but it works.

    of     1