So I have been working on a map changer. For some reason, the script wont load the map. Please help me. Also since I'm using a desktop, I've been experiencing problems on this site. Ads popped up by google covering up the ask question button. I had to use inspect element. Hint: i put the map changer script in server storage in the maps folder
while true do
local msg1 = Instance.new("Message",game.Workspace)
msg1.Text = "MAP LOADING: Sword fights on the heights (by shedletsky) Game lasts for 2 minutes."
wait(2)
msg1:Destroy()
script.Parent.swordFights.Sky.Parent = game.Lighting
script.Parent.swordFights.["Sword Fights on the Heights"].Parent = game.Workspace
wait(120)
game.Workspace.["Sword Fights on the heights"]:Destroy()
game.Lighting.Sky:Destroy()
local msg2 = Instance.new("Message",game.Workspace)
msg2.Text = "MAP LOADING: Doomspire Brickbattle (by roblox) Game lasts for 2 minutes."
wait(2)
msg2:Destroy()
script.Parent.doomMap.Sky.Parent = game.Lighting
script.Parent.doomMap.["Doomspire Brickbattle"].Parent = game.Workspace
wait(120)
game.Workspace.["Doomspire Brickbattle"]:Destroy()
game.Lighting.Sky:Destroy()
local msg3 = Instance.new("Message",game.Workspace)
msg1.Text = "MAP LOADING: Chaos Canyon (by roblox) Game lasts for 2 minutes."
wait(2)
msg1:Destroy()
script.Parent.chaosCanyon.Sky.Parent = game.Lighting
script.Parent.chaosCanyon.["Canyon"].Parent = game.Workspace
wait(120)
game.Workspace.["Canyon"]:Destroy()
game.Lighting.Sky:Destroy()
local msg4 = Instance.new("Message",game.Workspace)
msg5.Text = "MAP LOADING: Haunted Mansion (by telamon) Game lasts for 2 minutes."
wait(2)
msg5:Destroy()
script.Parent.hauntedMansion.Sky.Parent = game.Lighting
script.Parent.hauntedMansion.["Mansion"].Parent = game.Workspace
wait(120)
game.Workspace.["Mansion"]:Destroy()
game.Lighting.Sky:Destroy()
wait()
end
Please help.

4 comments
It still does not work. Can you try another method?
did you try deleting the undeclared variables?
what do you mean undeclared?
omg i get it now, im so dumb. thanks for helping!!