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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 1818 |
|
|
| 15 Jan 2011 11:16 AM |
| Thanks :D:D:D Your amazing :D |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2011 11:16 AM |
Try and learn from it aswell. It would help you to become a better scripter. |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
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 |
|
|
|
| 15 Jan 2011 11:50 AM |
| ou mean like lobby? just make it in workspace it should go anywhere |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 1818 |
|
|
| 15 Jan 2011 12:00 PM |
| Ohh wait Ic I understand it now. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 1818 |
|
|
| 15 Jan 2011 12:04 PM |
| yea I saw that after I posted lol |
|
|
| Report Abuse |
|
|
| |
|
cj10127
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 1818 |
|
| |
|
|
| 15 Jan 2011 03:35 PM |
| I need that code and I cant copy it right now, so I post here. |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2011 03:37 PM |
| Soul, if you're reading this, PM the script to me. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 15 Jan 2011 04:16 PM |
| Leave it ungrouped in Workspace. |
|
|
| Report Abuse |
|
|