So, I know what
game.Lighting.TimeOfDay = 21.00 means, and I want to learn those bigger scripts, but I get SO CONFUSED WHEN I DO!! I want to create a map changer, but I know
game.Lighting.Map.Insert = 5.00 wait (25) game.Lighting.Map1.Insert 5.00 wait (25) end
Won't work. Can anyone please help me?
What I usually do for map changers is to put the maps inside a Configuration called "Maps" that is inside the ServerStorage. I then have a variable that keeps track of which map is in Workspace. Then I can reparent the maps however I want. It looks like this:
CurMap = nil function SwitchMap(MapName) for _,Map in pairs (game:GetService("ServerStorage").Maps:GetChildren()) do if MapName == Map.Name then if CurMap then CurMap.Parent = game:GetService("ServerStorage").Maps Map.Parent = game.Workspace CurMap = Map end end end
Oh. I was totally wrong. I'm brand new to scripting, and thank you!
Hello,
There is a similar question HERE. Perhaps your answer could be in there as well.
What you would need to do: Put all the maps into Lighting/ServerStorage
Put all the maps into a table, use math.random, and then load it into Workspace.
A script if you want it:
--[[ All you need to do is put all the maps into Lighting, and name them "Map" + a random number Example: > Lighting -->Map1 -->Map2 etc ]]-- maps = {} function LoadMaps() for i,v in pairs(game.Lighting:GetChildren()) do if string.lower(string.sub(v,1,3)) == "map" then table.insert(maps, v.Name) end end end LoadMaps() function SelectMap() local n = math.random(1,#maps) local map = game.Lighting:FindFirstChild(maps[n]) local newmap = map:Clone() newmap.Parent = game.Workspace end SelectMap()