|
| 07 Mar 2012 03:15 PM |
----------------------------------------[[SETTINGS]]---------------------------------------- --[[]] money1 = 150 -- --[[]] money2 = 100 -- --------------------------------------------------------------------------------------------
h = Instance.new("Hint") h.Parent = game.Workspace h.Text = ""
RegTeam = Instance.new("Team") RegTeam.Name = "Players" RegTeam.TeamColor = BrickColor.new("Medium stone grey") RegTeam.Parent = game:GetService("Teams")
function round() cc = 0 c = game.Players:GetChildren() for num, obj in pairs(c) do if obj:FindFirstChild("Playing") then if obj.Playing.Value then cc = cc + 1 end end end while cc < 2 do cc = 0 c = game.Players:GetChildren() for num, obj in pairs(c) do if obj:FindFirstChild("Playing") then if obj.Playing.Value then cc = cc + 1 end end end h.Text = "Atleast 2 players needed to play." wait(1) end h.Text = "New Tournament Is Starting" wait(3) h.Text = "Choosing Map......." wait(5) m = game.Lighting.Minigames:GetChildren() mg = m[math.random(1,#m)] map = mg.Map map.Parent = game.Workspace h.Text = ("Map Found It's"..mg.Name) wait(3) h.Text = "Teleporting players and giving tools..." wait(3) c = game.Players:GetChildren() balanced = true red = 0 blue = 0 if mg.Mode.Value == 3 then rt = Instance.new("Team") rt.Parent = game:GetService("Teams") rt.AutoAssignable = false rt.TeamColor = BrickColor.new("Bright red") rt.Name = "Red team" bt = Instance.new("Team") bt.Parent = game:GetService("Teams") bt.AutoAssignable = false bt.TeamColor = BrickColor.new("Bright blue") bt.Name = "Blue team" end for num, obj in pairs(c) do if obj then if obj.Playing.Value and obj.Character:FindFirstChild("Torso") then if mg.Mode.Value == 3 then for numm, objj in pairs(mg.Tools:GetChildren()) do objj:clone().Parent = obj.Backpack wait() end cc = map:GetChildren() if balanced then team = math.random(1,2) if team == 1 then red = red + 1 obj.TeamColor = BrickColor.new("Bright red") elseif team == 2 then blue = blue + 1 obj.TeamColor = BrickColor.new("Bright blue") end teles = {} for nuum, obbj in pairs(cc) do if team == 1 then if obbj.Name == "RedTele" then table.insert (teles, obbj) end elseif team == 2 then if obbj.Name == "BlueTele" then table.insert (teles, obbj) end end wait() end tele = teles[math.random(1,#teles)] x1 = tele.Position.X-(tele.Size.X/2) x2 = tele.Position.X+(tele.Size.X/2) z1 = tele.Position.Z-(tele.Size.Z/2) z2 = tele.Position.Z+(tele.Size.Z/2) obj.Character.Torso.CFrame = CFrame.new(math.random(x1,x2),tele.Position.Y+5,math.random(z1,z2)) balanced = false else if red < blue then team = 1 else team = 2 end if team == 1 then red = red + 1 obj.TeamColor = BrickColor.new("Bright red") elseif team == 2 then blue = blue + 1 obj.TeamColor = BrickColor.new("Bright blue") end teles = {} for nuum, obbj in pairs(cc) do if team == 1 then if obbj.Name == "RedTele" then table.insert (teles, obbj) end elseif team == 2 then if obbj.Name == "BlueTele" then table.insert (teles, obbj) end end wait() end tele = teles[math.random(1,#teles)] x1 = tele.Position.X-(tele.Size.X/2) x2 = tele.Position.X+(tele.Size.X/2) z1 = tele.Position.Z-(tele.Size.Z/2) z2 = tele.Position.Z+(tele.Size.Z/2) obj.Character.Torso.CFrame = CFrame.new(math.random(x1,x2),tele.Position.Y+5,math.random(z1,z2)) balanced = true end obj.Character.Humanoid.WalkSpeed = 0 obj.PlayerGui.Play.Alive.Value = true wait() else for numm, objj in pairs(mg.Tools:GetChildren()) do objj:clone().Parent = obj.Backpack wait() end cc = map:GetChildren() teles = {} for nuum, obbj in pairs(cc) do if obbj.Name == "Tele" then table.insert (teles, obbj) end wait() end tele = teles[math.random(1,#teles)] x1 = tele.Position.X-(tele.Size.X/2) x2 = tele.Position.X+(tele.Size.X/2) z1 = tele.Position.Z-(tele.Size.Z/2) z2 = tele.Position.Z+(tele.Size.Z/2) obj.Character.Torso.CFrame = CFrame.new(math.random(x1,x2),tele.Position.Y+5,math.random(z1,z2)) obj.Character.Humanoid.WalkSpeed = 0 obj.PlayerGui.Play.Alive.Value = true wait() end end end end h.Text = ("Rules: "..mg.Rules.Value) wait(5) h.Text = "Ready.." wait(1) h.Text = "Set.." wait(1) h.Text = "GO!" c = game.Players:GetChildren() for num, obj in pairs(c) do if obj.PlayerGui.Play.Alive.Value == true then obj.Character.Humanoid.WalkSpeed = 16 end wait() end wait(1) if mg.Mode.Value == 1 then count = 1 repeat count = count + 1 c = game.Players:GetChildren() count2 = {} for num, obj in pairs(c) do if obj.PlayerGui.Play.Alive.Value then table.insert (count2,obj) end wait() end h.Text = ("Time left: "..mg.Time.Value-count) wait(1) until count >= mg.Time.Value or #count2 <= 1 if #count2 > 1 then for num, obj in pairs(count2) do ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end wait() end h.Text = "Multiple players won." wait(2) stringz = {} for num, obj in pairs(count2) do table.insert (stringz, obj.Name) wait() end h.Text = ("And they are: "..table.concat (stringz,", ")) wait(3) h.Text = ("Each of them will get "..money2.." points!") wait(3) for num, obj in pairs(count2) do obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2 obj.PlayerGui.Play.Alive.Value = false wait() end elseif #count2 == 1 then ccc = count2[1].Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = count2[1].Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if count2[1].Character:FindFirstChild("Torso") then count2[1].Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end h.Text = ("The winner was "..count2[1].Name.."!") wait(3) h.Text = ("And he will be awarded with "..money1.." points!") wait(3) count2[1].leaderstats.Points.Value = count2[1].leaderstats.Points.Value + money1 count2[1].PlayerGui.Play.Alive.Value = false elseif #count2 == 0 then h.Text = "In this round no one won. I hope you will have better luck next time." end elseif mg.Mode.Value == 2 then count = 0 won = nil map.FinishLine.Touched:connect(function(t) if game.Players:FindFirstChild(t.Parent.Name) then won = game.Players[t.Parent.Name] end end) repeat count = count + 1 h.Text = ("Time left: "..mg.Time.Value-count) wait(1) until count >= mg.Time.Value or won ~= nil
if won ~= nil then for num, obj in pairs(game.Players:GetChildren()) do if obj then if obj.PlayerGui.Play.Alive.Value then ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end end end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end wait() end h.Text = ("The winner was "..won.Name.."!") wait(3) h.Text = ("And he will get awarded with "..money1.." points!") wait(3) won.leaderstats.Points.Value = won.leaderstats.Points.Value + money1 won.PlayerGui.Play.Alive.Value = false else h.Text = "In this round no one won. I hope you will have better luck next time." end elseif mg.Mode.Value == 3 then count = 1 repeat count = count + 1 c = game.Players:GetChildren() count2 = {} count3 = {} for num, obj in pairs(c) do if obj then if obj.PlayerGui.Play.Alive.Value then if obj.TeamColor == BrickColor.new("Bright red") then table.insert (count2,obj) elseif obj.TeamColor == BrickColor.new("Bright blue") then table.insert (count3, obj) end end end wait() end h.Text = ("Time left: "..mg.Time.Value-count) wait(1) until count >= mg.Time.Value or #count2 <= 0 or #count3 <= 0 if #count2 == #count3 then for num, obj in pairs(count2) do ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end wait() end for num, obj in pairs(count3) do ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end wait() end h.Text = "There was tie." wait(2) stringz = {} for num, obj in pairs(count2) do table.insert (stringz, obj.Name) wait() end wait(3) h.Text = ("Each player will get "..money2.." points!") wait(3) for num, obj in pairs(count2) do obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2 obj.PlayerGui.Play.Alive.Value = false wait() end for num, obj in pairs(count3) do obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2 obj.PlayerGui.Play.Alive.Value = false wait() end elseif #count2 > #count3 and #count3 > 0 then for num, obj in pairs(count2) do if obj then ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end wait() end for num, obj in pairs(count3) do ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end end wait() end h.Text = ("The winner was red team!") wait(3) h.Text = ("They will get awarded with "..money1.." points, but as some of enemies are still alive, theyr team will get "..money2.." points!") wait(3) wait(3) for num, obj in pairs(count2) do obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money1 obj.PlayerGui.Play.Alive.Value = false wait() end for num, obj in pairs(count3) do obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2 obj.PlayerGui.Play.Alive.Value = false wait() end elseif #count2 < #count3 and #count2 > 0 then for num, obj in pairs(count2) do ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end wait() end for num, obj in pairs(count3) do ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end wait() end h.Text = ("The winner was blue team!") wait(3) h.Text = ("They will get awarded with "..money1.." points, but as some of enemies are still alive, theyr team will get "..money2.." points!") wait(3) for num, obj in pairs(count2) do obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2 obj.PlayerGui.Play.Alive.Value = false wait() end for num, obj in pairs(count3) do obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money1 obj.PlayerGui.Play.Alive.Value = false wait() end elseif #count2 == 0 then for num, obj in pairs(count3) do ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end wait() end h.Text = ("The winner was blue team!") wait(3) h.Text = ("They will get awarded with "..money1.." points!") wait(3) for num, obj in pairs(count3) do obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money1 obj.PlayerGui.Play.Alive.Value = false wait() end elseif #count3 == 0 then for num, obj in pairs(count2) do ccc = obj.Backpack:GetChildren() for a, b in pairs(ccc) do b:remove() wait() end ccc = obj.Character:GetChildren() for a, b in pairs(ccc) do if b.className == "Tool" then b:remove() elseif b.className == "HooperBin" then b:remove() end wait() end if obj.Character:FindFirstChild("Torso") then obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0) end wait() end h.Text = ("The winner was red team!") wait(3) h.Text = ("They will get awarded with "..money1.." points!") wait(3) for num, obj in pairs(count2) do obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money1 obj.PlayerGui.Play.Alive.Value = false wait() end elseif #count2 == 0 then h.Text = "In this round no one won. I hope you will have better luck next time." end loldunno = game.Players:GetChildren() for olol, trolol in pairs(loldunno) do trolol.TeamColor = BrickColor.new("Medium stone grey") wait() end rt:remove() bt:remove() end map.Parent = mg round() end
round() |
|
|
| Report Abuse |
|
XNoBoomX
|
  |
| Joined: 08 May 2011 |
| Total Posts: 4731 |
|
|
| 09 Mar 2012 06:59 PM |
I hate to assume this, but you don't seem to familiar with this script and it seems familiar to me. Is this by any chance a free model you're trying to work in your place?
~{An Intellectual In Love With Bacon}~ |
|
|
| Report Abuse |
|