generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Help? (Kind've long.)

Previous Thread :: Next Thread 
reflicted is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. reflicted
Joined: 07 Nov 2012
Total Posts: 265
10 Nov 2012 08:25 AM
Sorry I meant memris.
Report Abuse
Memris is not online. 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 is not online. Memris
Joined: 14 Jun 2012
Total Posts: 160
10 Nov 2012 08:26 AM
Oh, cool no problem. :)
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
10 Nov 2012 09:12 AM
Yes, thats why its random xD.
Report Abuse
jobro13 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image