scripttable.NextLevelTrigger=function()
	TeleportToLevel("level6",1)
end

scripttable.LevelStart=function()
	ForeachNamedObject("BossLights",function(o) o:SetFrame(1) end)
	ForeachNamedObject("Bosses",function(o) o:SetPosition(10000,10000) end)
	ForeachNamedObject("TeleporterDoor",function(o) o:Lock() end)

	StandardIntro()
	if progress.level3==0 then
		ShowSmallMessage("LEVEL3 UNLOCKED!")
		progress.level3=1
		menu.EnableItem(level3i)
		menu.SetItemText(level3i,"")
	end
	
end

scripttable.TeleporterDoorTrigger=function()
	ForeachNamedObject("TeleporterDoor",function(o) o:Unlock() end)
end

scripttable.BossTrigger=function()
	ForeachNamedObject("BossLights",function(o) o:SetFrame(0) end)
	ForeachNamedObject("BossDoors",function(o) o:Lock() end)
	ForeachNamedObject("Bosses",function(o) o:SetPosition(o:GetStartPos()) end)

	local pl=player.GetPlayer()
	pl:SetStartPos(scripttable.TeleportDest[1]:GetPosition())

	scripttable.BossTrigger=function() end
	while #scripttable.Bosses>0 do
		Wait(0.5)
	end

	ForeachNamedObject("BossLights",function(o) o:SetFrame(1) end)
	ForeachNamedObject("BossDoors",function(o) o:Unlock() end)
end