reflicted
|
  |
| Joined: 07 Nov 2012 |
| Total Posts: 265 |
|
|
| 10 Nov 2012 08:13 AM |
This only picks map 1????
while true do wait(5) local m = math.random(1,2) local player = game.Players:GetPlayers() for i = 1, #player do msg = Instance.new("Message") msg.Parent = nil if m == 1 then msg.Parent = game.Workspace msg.Text = "[Bow Tag] Map Chosen: Small City" wait(3) msg.Text = "[Bow Tag] Better run, this maps not very big and easy to get tagged on!" --Change to tthe description of the minigame. game.Lighting.CityMap:clone().Parent = game.Workspace wait(3) local RandomPlayer = Game.Players:GetPlayers()[math.random(#Game.Players:GetPlayers())] if RandomPlayer.Character then RandomPlayer.Character:MoveTo(Vector3.new(11, 60.4, -55.5)) RandomPlayer.TeamColor = BrickColor.new("Bright red") print 'Tped Random Player' print 'Sucessfully Completed' end wait(3) for i,v in pairs(game.Players:GetPlayers()) do if v.TeamColor == BrickColor.new("Institutional white") then v.TeamColor = BrickColor.new("Bright green") player[i].Character:MoveTo(Vector3.new(55, 60.4, -55.5)) print 'Tped regular players' msg.Parent = game.Workspace msg.Text = "[Bow Tag] ROUND BEGIN!" wait(2) msg:remove() end end wait(3) --Change the 20, 111, 20 to the pos. of the minigame. msg:remove() wait(50) for i,v in pairs(game.Players:GetPlayers()) do v.TeamColor = BrickColor.new("Institutional white") v.Character.Torso:remove() game.Workspace.CityMap:remove()
end
if m == 2 then msg.Parent = game.Workspace msg.Text = "[Bow Tag] Map Chosen: Camp Site by gigabic" -- Change to a minigames name. wait(3) msg.Text = "[Bow Tag] Larger then some of the other maps, but still not huge!" --Change to the description of the minigame. game.Lighting.CampSite:clone().Parent = game.Workspace wait(3) local RandomPlayer = Game.Players:GetPlayers()[math.random(#Game.Players:GetPlayers())] if RandomPlayer.Character then RandomPlayer.Character:MoveTo(Vector3.new(11, 60.4, -55.5)) RandomPlayer.TeamColor = BrickColor.new("Bright red") print 'Tped Random Player' print 'Sucessfully Completed' end wait(3) for i,v in pairs(game.Players:GetPlayers()) do if v.TeamColor == BrickColor.new("Institutional white") then v.TeamColor = BrickColor.new("Bright green") player[i].Character:MoveTo(Vector3.new(55, 60.4, -55.5)) print 'Tped regular players' msg.Parent = game.Workspace msg.Text = "[Bow Tag] ROUND BEGIN!" wait(2) msg:remove() end end wait(3) --Change the 20, 111, 20 to the pos. of the minigame. msg:remove() wait(50) for i,v in pairs(game.Players:GetPlayers()) do v.TeamColor = BrickColor.new("Institutional white") v.Character.Torso:remove() game.Workspace.CityMap:remove() end |
|
|
| Report Abuse |
|
|
Memris
|
  |
| Joined: 14 Jun 2012 |
| Total Posts: 160 |
|
|
| 10 Nov 2012 08:14 AM |
while true do wait(5) local m = math.random(1,2) local player = game.Players:GetPlayers() for i = 1, #player do msg = Instance.new("Message") msg.Parent = nil if m == 1 then msg.Parent = game.Workspace msg.Text = "[Bow Tag] Map Chosen: Small City" wait(3) msg.Text = "[Bow Tag] Better run, this maps not very big and easy to get tagged on!" --Change to tthe description of the minigame. game.Lighting.CityMap:clone().Parent = game.Workspace wait(3) local RandomPlayer = Game.Players:GetPlayers()[math.random(#Game.Players:GetPlayers())] if RandomPlayer.Character then RandomPlayer.Character:MoveTo(Vector3.new(11, 60.4, -55.5)) RandomPlayer.TeamColor = BrickColor.new("Bright red") print 'Tped Random Player' print 'Sucessfully Completed' end wait(3) for i,v in pairs(game.Players:GetPlayers()) do if v.TeamColor == BrickColor.new("Institutional white") then v.TeamColor = BrickColor.new("Bright green") player[i].Character:MoveTo(Vector3.new(55, 60.4, -55.5)) print 'Tped regular players' msg.Parent = game.Workspace msg.Text = "[Bow Tag] ROUND BEGIN!" wait(2) msg:remove() end end wait(3) --Change the 20, 111, 20 to the pos. of the minigame. msg:remove() wait(50) for i,v in pairs(game.Players:GetPlayers()) do v.TeamColor = BrickColor.new("Institutional white") v.Character.Torso:remove() game.Workspace.CityMap:remove()
elseif m == 2 then msg.Parent = game.Workspace msg.Text = "[Bow Tag] Map Chosen: Camp Site by gigabic" -- Change to a minigames name. wait(3) msg.Text = "[Bow Tag] Larger then some of the other maps, but still not huge!" --Change to the description of the minigame. game.Lighting.CampSite:clone().Parent = game.Workspace wait(3) local RandomPlayer = Game.Players:GetPlayers()[math.random(#Game.Players:GetPlayers())] if RandomPlayer.Character then RandomPlayer.Character:MoveTo(Vector3.new(11, 60.4, -55.5)) RandomPlayer.TeamColor = BrickColor.new("Bright red") print 'Tped Random Player' print 'Sucessfully Completed' end wait(3) for i,v in pairs(game.Players:GetPlayers()) do if v.TeamColor == BrickColor.new("Institutional white") then v.TeamColor = BrickColor.new("Bright green") player[i].Character:MoveTo(Vector3.new(55, 60.4, -55.5)) print 'Tped regular players' msg.Parent = game.Workspace msg.Text = "[Bow Tag] ROUND BEGIN!" wait(2) msg:remove() end
wait(3) --Change the 20, 111, 20 to the pos. of the minigame. msg:remove() wait(50) for i,v in pairs(game.Players:GetPlayers()) do v.TeamColor = BrickColor.new("Institutional white") v.Character.Torso:remove() game.Workspace.CityMap:remove() end |
|
|
| Report Abuse |
|
|
reflicted
|
  |
| Joined: 07 Nov 2012 |
| Total Posts: 265 |
|
|
| 10 Nov 2012 08:16 AM |
Okay, I will try that.
print 'R3FLICT3D SCR1PTS' |
|
|
| Report Abuse |
|
|
Memris
|
  |
| Joined: 14 Jun 2012 |
| Total Posts: 160 |
|
|
| 10 Nov 2012 08:17 AM |
| If it doesn't work, try re positioning some ends, I might've messed up on removing the right one. Hehe |
|
|
| Report Abuse |
|
|
reflicted
|
  |
| Joined: 07 Nov 2012 |
| Total Posts: 265 |
|
|
| 10 Nov 2012 08:24 AM |
It glitches now, and ONLY choses Camp Site. I added the elseif end and fixed the error but it only choses it now -.- Any help?
print 'R3FLICT3D SCR1PTS' |
|
|
| Report Abuse |
|
|
reflicted
|
  |
| Joined: 07 Nov 2012 |
| Total Posts: 265 |
|
|
| 10 Nov 2012 08:25 AM |
I fixed it, thanks Mempis :)
print 'R3FLICT3D SCR1PTS' |
|
|
| Report Abuse |
|
|
reflicted
|
  |
| Joined: 07 Nov 2012 |
| Total Posts: 265 |
|
| |
|
Memris
|
  |
| Joined: 14 Jun 2012 |
| Total Posts: 160 |
|
|
| 10 Nov 2012 08:26 AM |
| Try it extensively. I know that math.random(1,2) can have the same output quite a few times in a row. |
|
|
| Report Abuse |
|
|
Memris
|
  |
| Joined: 14 Jun 2012 |
| Total Posts: 160 |
|
| |
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 10 Nov 2012 09:12 AM |
| Yes, thats why its random xD. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 10 Nov 2012 09:14 AM |
I just trried this:
local tab = {0,0} for i=1,1000000 do n = math.random(1,2) tab[n] = tab[n] + 1 end print(tab[1], tab[2])
Output: 500725 499275
Hmm... close :) Very good random number generator. |
|
|
| Report Abuse |
|
|