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 » Scripters
Home Search
 

Questions about two scripts

Previous Thread :: Next Thread 
RealistK is not online. RealistK
Joined: 20 Feb 2011
Total Posts: 3489
27 Dec 2013 05:40 AM
Okay so I have these two scripts:

rannum = math.random(1,3) --generate a random map(roblox is terrible at random numbers)
game.Lighting:FindFirstChild("Map"..rannum)Parent = game.Workspace

if rannum == 1 then --map positions
mapvector3 = Vector3.new(-358.3, -70.8, -560.9)
elseif rannum == 2 then
mapvector3 = Vector3.new(223.9, 87.8, -558.5)
elseif rannum == 3 then
mapvector3 = Vector3.new(24.992, 91.039, -200.813)
end

gp = game.Players:children() --teleport the players without getting them stuck
for num = 1, #gp do
gp[num].Torso.CFrame = mapvector3 + Vector3.new(math.random(-15, 15)/15), 0, math.random(-15, 15)/15))
end

--That would put the map in the workspace and teleport all characters very close to that point.



(It puts a red line in the script under this line, is this a right line??)
gp[num].Torso.CFrame = mapvector3 + Vector3.new(math.random(-15, 15)/15), 0, math.random(-15, 15)/15))



And



-- Make 3 models, name the first one Map1, name the second one Map2, name the third one Map3.
--In order, Put Map1 in Lighting, then Map2 in Lighting, then Map3 in Lighting.

while true do --This keeps the script running, if you delete this it, the script will get stuck at Map3 and will not go back to Map1.
game.Lighting.Map1:clone().Parent = game.Workspace
wait(120) --The time the game lasts in seconds. ( Set at 60 seconds / One minute. You can change this. )
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = ("Loading Desert City by AwesomeRobloxMarc") -- The name of the Map goes here. ( You can change it to a custom name like for a sword game : Sword fights on the noob! )
wait(2)
msg:remove()
game.Workspace.Map1:remove()
wait(30) --Time you have before the next game begins. ( You can change this. )

game.Lighting.Map2:clone().Parent = game.Workspace
wait(100) --The time the game lasts in seconds. ( Set at 60 seconds / One minute. You can change this. )
msg.Parent = game.Workspace
msg.Text = ("Loading Racing Circuit by RealistK") -- The name of the Map goes here. ( You can change it to a custom name like for a sword game : Sword fights on the noob! )
wait(2)
msg:remove()
game.Workspace.Map2:remove()
wait(30) --Time you have before the next game begins. ( You can change this. )

game.Lighting.Map3:clone().Parent = game.Workspace
wait(100) --The time the game lasts in seconds. ( Set at 60 seconds / One minute. You can change this. )
msg.Parent = game.Workspace
msg.Text = ("Loading Nuketown by RobloEagle") -- The name of the Map goes here. ( You can change it to a custom name like for a sword game : Sword fights on the noob! )
wait(2)
msg:remove()
game.Workspace.Map3:remove()
wait(30) --Time you have before the next game begins. ( You can change this. )



end

Now my question is, do I need both of these scripts?

And my other one is, it doesn't teleport the players with both of the scripts, do I need to remove one or is it just a mistake in the first script?

And yet my last question: when I start a server, it automatically shows the first map underneath the lobby (the place where it belongs) but then it gives this message of loading desert city, but that is my first map, and it shows the second. Then at the third map it says Loading Racing Circuit but that is my second map...
How do I prevent this and just make it right?
Report Abuse
OneTrueGodTheHolyCow is not online. OneTrueGodTheHolyCow
Joined: 24 Oct 2013
Total Posts: 9350
27 Dec 2013 05:49 AM
I felt a spreading muscle pain in my back when I read this thread.
Report Abuse
RealistK is not online. RealistK
Joined: 20 Feb 2011
Total Posts: 3489
27 Dec 2013 06:04 AM
x) how do I make it more clear?
Report Abuse
OneTrueGodTheHolyCow is not online. OneTrueGodTheHolyCow
Joined: 24 Oct 2013
Total Posts: 9350
27 Dec 2013 06:36 AM
Well post in Scripting Helpers not Scripters
Report Abuse
OneTrueGodTheHolyCow is not online. OneTrueGodTheHolyCow
Joined: 24 Oct 2013
Total Posts: 9350
27 Dec 2013 06:37 AM
http://www.roblox.com/Forum/ShowForum.aspx?ForumID=20
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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