of     2   
chevron_rightchevron_rightchevron_right

tarrdo
#139395902Sunday, July 06, 2014 5:39 AM GMT

while true do wait() --you need this, otherwise roblox will crash function MapSelector (Lighting, Workspace) a = math.random (1,3) if a == 1 then local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = ("Loading Map: Havoc") -- Upcoming Map Name wait(4) msg:remove() game.Lighting.Map1:clone().Parent = game.Workspace wait(20) -- Time between map changes wait(4) game.Workspace.Map1:remove() game.Lighting.FogEnd = 100000 -- removes fog from map wait (1) else if a == 2 then local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = ("Loading Map: Desert Troop") -- Upcoming Map Name wait(4) msg:remove() game.Lighting.Map2:clone().Parent = game.Workspace wait(20) -- Time between map changes wait(4) game.Workspace.Map2:remove() wait (1) else if a == 3 then local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = ("Loading Map: Harbor") -- Upcoming Map Name wait(4) msg:remove() game.Lighting.Map3:clone().Parent = game.Workspace wait(20) -- Time between map changes wait(4) game.Workspace.Map3:remove() wait (1) end end end end end I know I am missing something and it's probably obvious. I want my script to scroll through these maps at random(for now) and it doesn't even select a map in the first place. Ignore the fact that I have the maps on for 20 seconds each that is for testing purposes.
AnonyAnonymous
#139396023Sunday, July 06, 2014 5:41 AM GMT

Are you executing the function MapSelector()?.
tarrdo
#139429037Sunday, July 06, 2014 4:32 PM GMT

Well it isn't on disabled so I have no idea, I'm a beginner scripter
smiley599
#139429106Sunday, July 06, 2014 4:33 PM GMT

ah the days i was so inefficient
AntonioLorenzi
#139429421Sunday, July 06, 2014 4:37 PM GMT

this isnt even ur script lol
101airsoft
#139429846Sunday, July 06, 2014 4:43 PM GMT

This script is not a very good script because it will be hard to add maps in the future. So I am not going to show you the error, but re-write the script. local maps={game.Lighting:findFirstChild("Harbor"), game.Lighting:findFirstChild("Desert Troop")} --You add more local map chooseMap=function() local seed=math.random(1, #maps) local map=maps[seed] return (map) end notifyMapLoad=function(mapName) local msg=Instance.new("Message", workspace) msg.Parent=Workspace msg.Text=("Loading Map:" mapName) game.Debris:AddItem(msg, 4) end spawnMap=function(map) local clone=map:Clone() clone.Parent=workspace notifyMapLoad(clone.Name) end removeMap=function(map) map:remove() end while (true) do wait() map=chooseMap() spawnMap(map) wait(50) removeMap(map) end
101airsoft
#139429943Sunday, July 06, 2014 4:44 PM GMT

Sorry for any errors/typos, I wrote this directly on the forum. Good luck ;)
smiley599
#139430000Sunday, July 06, 2014 4:45 PM GMT

game.ServerStorage:findFirstChild("Map"..map) ...
101airsoft
#139430086Sunday, July 06, 2014 4:46 PM GMT

Well I'm sorry, I learned before roblox added that.
tarrdo
#139454063Sunday, July 06, 2014 8:53 PM GMT

@Nice coder, this is my script the script I had before was linear and spawned the maps in order, I rewrote it to have the maps be random, but thank you for being rude, go somewhere else if you're going to be toxic and judgmental
tarrdo
#139454235Sunday, July 06, 2014 8:54 PM GMT

The maps are actually named Map1 Map2 Map3 inside lighting cause it was easier to line them up originally that way.
smiley599
#139454703Sunday, July 06, 2014 8:58 PM GMT

You don't need an if statement checking the number. My map chooser doesn't have any if statements.
nobbers12345
#139454924Sunday, July 06, 2014 9:00 PM GMT

> inside lighting Roblox is moving away from storing things in lighting. Store things in ServerStorage. I hate the LGBT. Those laser guided battle tanks are just too damn powerful.
tarrdo
#139455052Sunday, July 06, 2014 9:01 PM GMT

That signature (thumbs up)
GeneralPsyBeam
#139457564Sunday, July 06, 2014 9:27 PM GMT

write elseif not else if
smiley599
#139461036Sunday, July 06, 2014 10:01 PM GMT

Don't even use if
101airsoft
#139464037Sunday, July 06, 2014 10:32 PM GMT

Did my script work for you?
tarrdo
#139472363Monday, July 07, 2014 12:04 AM GMT

So smiley essentially you are saying this is what it should look like function MapSelector (ServerStorage, Workspace) a = math.random (1,3) a = 1 local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = ("Loading Map: Havoc") -- Upcoming Map Name wait(4) msg:remove() game.ServerStorage.Map1:clone().Parent = game.Workspace wait(20) -- Time between map changes wait(4) game.Workspace.Map1:remove() game.Lighting.FogEnd = 100000 -- removes fog from map wait (1) a = 2 local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = ("Loading Map: Desert Troop") -- Upcoming Map Name wait(4) msg:remove() game.ServerStorage.Map2:clone().Parent = game.Workspace wait(20) -- Time between map changes wait(4) game.Workspace.Map2:remove() wait (1) a = 3 local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = ("Loading Map: Harbor") -- Upcoming Map Name wait(4) msg:remove() game.ServerStorage.Map3:clone().Parent = game.Workspace wait(20) -- Time between map changes wait(4) game.Workspace.Map3:remove() wait (1) end end And if so how does it know if a selected 1,2,3 without the if statements being there, it sounds like you want me to load all 3 maps at once.
tarrdo
#139475313Monday, July 07, 2014 12:36 AM GMT

Airsoft I will try your script out but I prefer to use my own, if it works I will let you know if not and I can fix it I will fix it and post it here. :)
tarrdo
#139475974Monday, July 07, 2014 12:43 AM GMT

Your script doesn't work, nor do I have any knowledge of scripting that could help you, my scripts are big and sloppy the way I like them and understand them. :)
fajner1
#139479635Monday, July 07, 2014 1:18 AM GMT

Big, sloppy, linear scripts are often easier to make when diving right in, but if you try to convert the major part into a function, it might help you find the error (not to mention improve expandability). The three large blocks of code are identical to each other except for the name and location of the map. If you wanted to change the wait times, for example, you would have to go into each blocks and change them, but if you turn it into a function, you only have to do it once. /* function nextMap(mapName, mapLocation) print("[Debug] Map "..mapName.." loaded") local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = ("Loading Map: "..mapName) -- Upcoming Map Name wait(4) msg:remove() local map = mapLocation:clone() map.Parent = game.Workspace wait(24) -- Time between map changes map:remove() game.Lighting.FogEnd = 100000 -- removes fog from map wait (1) end while true do wait() local choice = math.random(1,3) if choice == 1 then nextMap("Havoc", game.ServerStorage.Map1) elseif choice == 2 then nextMap("Desert Troop", game.ServerStorage.Map2) elseif choice == 3 then nextMap("Harbor", game.ServerStorage.Map3) end end */
tarrdo
#139502813Monday, July 07, 2014 5:01 AM GMT

It didn't work, no error it just never selected a map in the first place. Maybe if I give you my original map script and we just tweak it to randomly select a map instead of trying to make a new script.
tarrdo
#139506239Monday, July 07, 2014 5:44 AM GMT

Ignore that your script did work but I had my script deactivated, though I only noticed it was deactivated when I rewrote my script to ensure it would work and added print scripts and since nothing printed I knew it was off I have a working script that I made and even if it is sloppy im keeping it for the sake of having it my own.
smiley599
#139511294Monday, July 07, 2014 6:58 AM GMT

Stop using if statements u nobs
tarrdo
#139537504Monday, July 07, 2014 4:09 PM GMT

Stop using if statements u nobs Friends: 4 Forum Posts: 18,357 Place Visits: 0 Knockouts: 6,494 Highest Ever Voting Accuracy: 79% I don't think you bothered to read what I had said but I did remove the if statements and it doesn't work, so how about you and your 0 place visits with your pro scripting skills shove it?

    of     2   
chevron_rightchevron_rightchevron_right