jjkiki
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 216 |
|
|
| 21 Feb 2014 09:14 PM |
| how do I make it load a random map from the 5 maps I have and then TP the users down to the TP locations on that map? |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 21 Feb 2014 09:26 PM |
maps = {map1,map2,map3,map4,map5} for i = 1, maps do c = game.Lighting.(math.random[i]):clone() --'Lighting.('.. Ehm.. idk lol c.Parent = game.Workspace c:MoveTo(position) c:MakeJoints() end wait(2) for i,v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = CFrame.new(position) end
999th post |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 21 Feb 2014 09:27 PM |
Actually I think it would go like;
maps = {map1,map2,map3,map4,map5} for i,v in pairs((math.random[(1)maps])) do --Don't know about (1) c = game.Lighting.v:clone() c.Parent = game.Workspace c:MoveTo(position) c:MakeJoints() end wait(2) for i,v in pairs(game.Players:GetChildren()) do v.Character:MoveTo(position) end
1000th post |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2014 09:31 PM |
maps = {ServerStorage.map1:clone() ServerStorage.map2:clone(), ServerStorage.map3:clone(), ServerStorage.map4:clone(), ServerStorage.map5:clone()}
function executeRound() local chosenMap = maps[math.random(1, #maps)]:clone() chosenMap.Parent = Workspace for i, v in pairs(game.Players:GetPlayers()) do if v.Character then v.Character:MoveTo(Vector3.new(x, y, z)) end end wait(ROUND TIME) chosenMap:Destroy() end
Put all the maps in ServerStorage, and replace 'map[1 - 5]' with the map name. |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2014 09:31 PM |
| Oh, my bad. You have to put 'game.' in front of ServerStorage. |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2014 09:34 PM |
I FORGOT A COMMA! Here is the fixed version, lol.
maps = { game.ServerStorage.map1:clone(), game.ServerStorage.map2:clone(), game.ServerStorage.map3:clone(), game.ServerStorage.map4:clone(), game.ServerStorage.map5:clone() }
function executeRound() local chosenMap = maps[math.random(1, #maps)]:clone() chosenMap.Parent = Workspace for i, v in pairs(game.Players:GetPlayers()) do if v.Character then v.Character:MoveTo(Vector3.new(x, y, z)) end end wait(ROUND TIME) chosenMap:Destroy() end
|
|
|
| Report Abuse |
|
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 21 Feb 2014 09:36 PM |
| Ohhhhhkayyy... yeah wasn't sure if I should put an array with the 'game.Lighting' or 'game.ServerStorage' |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2014 09:38 PM |
You don't need a loop to find a random map.
|
|
|
| Report Abuse |
|
|
jjkiki
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 216 |
|
| |
|