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: How do I make the map change

Previous Thread :: Next Thread 
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 11:08 AM
Heya, I am not asking for this to be done I just want to know how It would be done. I want to make a sword fighting game where there are loads of maps and one is randomly chosen every 7 minutes how do I make it choose and import a random map each 7 mins? lol
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 11:11 AM
Basicly, you would put all of your maps in Lighting and do this:


num = 5 --Change 5 to the number of maps you have
maps = { "Map1", "Map2", "Map3", "Map4", "Map5" } --Put their names here, add more if you have to
time = 60 --time in seconds between each map change
m = math.random(1,num)
function change()
t = game.Lighting:findFirstChild(maps[m]):clone()
t.Parent = workspace
end
while true do
wait()
change()
wait(time)
t:remove()
end

Made from scratch, might not work but have a go!
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 11:13 AM
o.O you even made a script. But thanks I was wondering how it would be done. and one more thing what is the script I put to make a message show on the screen? lolz never known it but would love to know.
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 11:13 AM
Sorry, I mean this:



num = 5 --Change 5 to the number of maps you have
maps = { "Map1", "Map2", "Map3", "Map4", "Map5" } --Put their names here, add more if you have to
time = 2 --time in seconds between each map change
function change()
m = math.random(1,num)
t = game.Lighting:findFirstChild(maps[m]):clone()
t.Parent = workspace
end
while true do
wait()
change()
wait(time)
t:remove()
end
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 11:15 AM
Here we go:



num = 5 --Change 5 to the number of maps you have
maps = { "Map1", "Map2", "Map3", "Map4", "Map5" } --Put their names here, add more if you have to
time = 60 --time in seconds between each map change
function change()
m = math.random(1,num)
t = game.Lighting:findFirstChild(maps[m]):clone()
t.Parent = workspace
ms = Instance.new("Message",workspace)
ms.Text = game.Lighting:findFirstChild(maps[m]).Name.. " has been chosen."
wait(5)
ms:remove()
end
while true do
wait()
change()
wait(time)
t:remove()
end
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 11:16 AM
Thanks :D:D:D Your amazing :D
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 11:16 AM
Try and learn from it aswell.
It would help you to become a better scripter.
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 11:18 AM
yea I will. The stuff I dont understand I will search on wik.roblox.com to try and understand it :)
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 11:19 AM
Okay. Goodluck.
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 11:27 AM
Wait...Lets say I want to start of with one map I already have made would I keep that in workspace and then it just wont be used again after that time? Or if it is in lighting you cant see it and there wont be a map to spawn to when a server starts?
Report Abuse
deividaxas is not online. deividaxas
Joined: 20 Feb 2009
Total Posts: 1054
15 Jan 2011 11:50 AM
ou mean like lobby? just make it in workspace it should go anywhere
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 11:52 AM
No not a lobby ther eis no lobby tis just non stop fighting and I want a map to start of there but it can still be randomly picked?...Wait I know how lol
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 11:53 AM
Umm...

Try this:



num = 5 --Change 5 to the number of maps you have
main = "Lobby" --whatever the start map will be
maps = { "Map1", "Map2", "Map3", "Map4", "Map5" } --Put their names here, add more if you have to
time = 60 --time in seconds between each map change
function change()
m = math.random(1,num)
t = game.Lighting:findFirstChild(maps[m]):clone()
t.Parent = workspace
ms = Instance.new("Message",workspace)
ms.Text = game.Lighting:findFirstChild(maps[m]).Name.. " has been chosen."
wait(5)
ms:remove()
end
function mainit()
game.Workspace[main]:remove()
end
while true do
wait(time)
mainit()
change()
wait(time)
t:remove()
end
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 11:54 AM
Oh, if you want it also to be able to be randomly picked PLUS the first map:


num = 6 --Change 6 to the number of maps you have
main = "First-Map" --whatever the start map will be
maps = { "Map1", "Map2", "Map3", "Map4", "Map5", "First-Map" } --Put their names here, add more if you have to
time = 60 --time in seconds between each map change
function change()
m = math.random(1,num)
t = game.Lighting:findFirstChild(maps[m]):clone()
t.Parent = workspace
ms = Instance.new("Message",workspace)
ms.Text = game.Lighting:findFirstChild(maps[m]).Name.. " has been chosen."
wait(5)
ms:remove()
end
function mainit()
game.Workspace[main]:remove()
end
while true do
wait(time)
mainit()
change()
wait(time)
t:remove()
end
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 11:55 AM
Whoops, that will error:



num = 6 --Change 6 to the number of maps you have
main = "First-Map" --whatever the start map will be
maps = { "Map1", "Map2", "Map3", "Map4", "Map5", "First-Map" } --Put their names here, add more if you have to
time = 60 --time in seconds between each map change
function change()
m = math.random(1,num)
t = game.Lighting:findFirstChild(maps[m]):clone()
t.Parent = workspace
ms = Instance.new("Message",workspace)
ms.Text = game.Lighting:findFirstChild(maps[m]).Name.. " has been chosen."
wait(5)
ms:remove()
end
function mainit()
game.Workspace[main]:remove()
end
wait(time)
mainit()
while true do
wait()
change()
wait(time)
t:remove()
end
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 11:58 AM
Ohh ok and does the first map have to be called "First Map"
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 12:00 PM
Ohh wait Ic I understand it now.
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 12:00 PM
It can be called anything,


Just make sure to rename the two parts in that script that has 'First-Map' in it.
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 12:04 PM
yea I saw that after I posted lol
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 12:07 PM
:3

Hope I helped.
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 12:27 PM
yea you did. Loads :)
Report Abuse
PerfectRobloxer is not online. PerfectRobloxer
Joined: 03 Aug 2009
Total Posts: 1696
15 Jan 2011 03:35 PM
I need that code and I cant copy it right now, so I post here.
Report Abuse
PerfectRobloxer is not online. PerfectRobloxer
Joined: 03 Aug 2009
Total Posts: 1696
15 Jan 2011 03:37 PM
Soul, if you're reading this, PM the script to me.
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
15 Jan 2011 03:44 PM
Soul, With this do I just put the main map (the starting one) in lighting? or do I leave it in Workspace?
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
15 Jan 2011 04:16 PM
Leave it ungrouped in Workspace.
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