|
| 20 Jan 2014 12:25 PM |
I'm making a TDJ (Team DeathMatch Juggernaut) And The whole game is based on a GUI. How would I randomly scramble players onto teams and then teleport them all to one position then random ones? Not troll, sorry for such a big question, FailzStrat |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2014 12:37 PM |
p=game.Players:GetChildren() for i=1,#p do n=math.random(1,2) if n == 1 then p[i].TeamColor = BrickColor.new("Bright red").Color elseif n== 2 then p[i].TeamColor = BrickColor.new("Navy blue").Color end end game.Teams:RebalanceTeams()
|
|
|
| Report Abuse |
|
|
|
| 20 Jan 2014 12:45 PM |
p=game.Players:GetChildren() for i=1,#p do n=math.random(1,2) if n == 1 then p[i].TeamColor = BrickColor.new("Bright red").Color elseif n== 2 then p[i].TeamColor = BrickColor.new("Navy blue").Color end end for i=1, #p do if p[i].TeamColor == BrickColor.new("Bright red").Color then p[i].Character:MoveTo(game.Workspace.PARTNAME.Position) elseif p[i].TeamColor == BrickColor.new("Navy blue").Color then p[i].Character:MoveTo(game.Workspace.PARTNAME.Position) end end game.Teams:RebalanceTeams() |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2014 01:48 PM |
--Settings: generalroundtime = 300 --round duration (5 minutes) intermissiontime = 30 --seconds between rounds mapsource = game.ServerStorage.Maps --Documents the location of the maps --End Settings -----DO NOT EDIT ANYTHING BELOW-------- maps = {} --LEAVE EMPTY, if you put a map name it increases the chances of that map getting selected. getmaps = mapsource:GetChildren() --Gets the Maps from ServerStorage.Maps for i=1,#getmaps do --For every map maps[#maps+1] = getmaps[i] --get how many maps are in the table maps and add the map names into it --this makes all the maps be in the table automatically for you end
function choosemap() selectmap = math.random(1,#maps) if selectmap ~= nil then print(selectmap) m=Instance.new("Message",Workspace) m.Text = "This rounds map is:".. selectmap wait(3) m:remove() mapname = maps[selectmap] print(mapname) realmap = mapsource[tostring(mapname)] clonemap = realmap:Clone() clonemap.Parent = game.Workspace --clonemap2 = game.Workspace[realmap.Name] end end
while true do wait(30) choosemap() wait(300) --5 minutes m=Instance.new("Message",Workspace) m.Text = "Round over." wait(4) m:remove() end
end game.Teams:RebalanceTeams()
|
|
|
| Report Abuse |
|
|