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.
Well their are a few problems with this script one of them being that you cant use .[] like this
game.Workspace.["Mansion"]:Destroy()
you gotta delete the . before the [ to make it work
Another problem with this script is the undeclared msg5, I'm going to leave that in my script because I believe that u have declared that on another part of the script if not then delete msg5.
Solution:
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." --UNDECLEARED wait(2) msg5:Destroy() --UNDECLEARED 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