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 please

Previous Thread :: Next Thread 
jjkiki is not online. 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 is not online. 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 is not online. 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
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
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
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
21 Feb 2014 09:31 PM
Oh, my bad. You have to put 'game.' in front of ServerStorage.
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
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
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
21 Feb 2014 09:36 PM
@Goul

Not even close, lol.
Report Abuse
Goulstem is not online. 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
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
21 Feb 2014 09:38 PM
You don't need a loop to find a random map.
Report Abuse
jjkiki is not online. jjkiki
Joined: 19 Oct 2012
Total Posts: 216
21 Feb 2014 09:40 PM
ok thanks for your help
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