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
 

Make Map Generating Random?

Previous Thread :: Next Thread 
Inevitably is not online. Inevitably
Joined: 13 Jul 2012
Total Posts: 514
23 Nov 2012 05:47 PM
How will I make it random?:
map1 = game.Lighting:findFirstChild("Map1")
map2 = game.Lighting:findFirstChild("Map2")
map3 = game.Lighting:findFirstChild("Map3")
map4 = game.Lighting:findFirstChild("Map4")
map5 = game.Lighting:findFirstChild("Map5")
time = 300
clone1 = map1:clone()
clone2 = map2:clone()
clone3 = map3:clone()
clone4 = map4:clone()
clone5 = map5:clone()
wait()
map1:remove()
map2:remove()
map3:remove()
map4:remove()
map5:remove()
while true do
local map = clone1:clone()
map.Parent = game.Workspace
wait(time)
map:remove()
local map = clone2:clone()
map.Parent = game.Workspace
wait(time)
map:remove()
local map = clone3:clone()
map.Parent = game.Workspace
wait(time)
map:remove()
local map = clone4:clone()
map.Parent = game.Workspace
wait(time)
map:remove()
local map = clone5:clone()
map.Parent = game.Workspace
wait(time)
map:remove()
end

function Map1Raise()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map1:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame + Vector3.new(0,2,0) end end
end
end
function Map1Fall()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map1:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,2,0) end end
end
end

function Map2Raise()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map2:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame + Vector3.new(0,2,0) end end
end
end
function Map2Fall()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map2:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,2,0) end end
end
end

function Map3Raise()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map3:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame + Vector3.new(0,2,0) end end
end
end
function Map3Fall()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map3:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,2,0) end end
end
end

function Map4Raise()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map4:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame + Vector3.new(0,2,0) end end
end
end
function Map4Fall()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map4:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,2,0) end end
end
end

function Map5Raise()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map5:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame + Vector3.new(0,2,0) end end
end
end
function Map5Fall()
for r = 1,236 do
wait(0.01)
for r,p in pairs(game.Workspace.Map5:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,2,0) end end
end
end

function Map1()
local map = clone1:clone()
local spawn = clone6:clone()
map.Parent = game.Workspace
spawn.Parent = game.Workspace
wait(0.1)
Map1Raise()
wait(time)
Map1Fall()
wait(0.1)
map:remove()
spawn:remove()
end

function Map2()
local map = clone2:clone()
local spawn = clone7:clone()
map.Parent = game.Workspace
spawn.Parent = game.Workspace
wait(0.1)
Map2Raise()
wait(time)
Map2Fall()
wait(0.1)
map:remove()
spawn:remove()
end

function Map3()
local map = clone3:clone()
local spawn = clone8:clone()
map.Parent = game.Workspace
spawn.Parent = game.Workspace
wait(0.1)
Map3Raise()
wait(time)
Map3Fall()
wait(5)
map:remove()
spawn:remove()
end

function Map4()
local map = clone4:clone()
local spawn = clone9:clone()
map.Parent = game.Workspace
spawn.Parent = game.Workspace
wait(0.1)
Map4Raise()
wait(time)
Map4Fall()
wait(0.1)
map:remove()
spawn:remove()
end

function Map5()
local map = clone5:clone()
local spawn = clone10:clone()
map.Parent = game.Workspace
spawn.Parent = game.Workspace
wait(0.1)
Map5Raise()
wait(time)
Map5Fall()
wait(0.1)
map:remove()
spawn:remove()
end

while true do
Map1()
wait()
Map2()
wait()
Map3()
wait()
Map4()
wait()
Map5()
wait()
end
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
23 Nov 2012 05:49 PM
hey, why not try responding to the first thread instead of creating a new one, next time, will you?
Report Abuse
Inevitably is not online. Inevitably
Joined: 13 Jul 2012
Total Posts: 514
23 Nov 2012 05:54 PM
At least answer my question..
How will you make the map generating random?
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
23 Nov 2012 06:00 PM
Did you look at the other thread?

Put the maps in a table, and use math.random on that table.
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