-- Move ScreenGuis into PlayerGui:

local shouldRemove = true
for i,v in ipairs(guis:GetChildren()) do
	if (v:IsA("LayerCollector") and v.ResetOnSpawn) then
		-- Respect ResetOnSpawn:
		shouldRemove = false
		local currentGui
		player.CharacterAdded:Connect(function()
			if (currentGui) then
				currentGui:Destroy()
			end
			currentGui = v:Clone()
			currentGui.Parent = playerGui
		end)
	else
		-- Move objects to PlayerGui:
		v.Parent = playerGui
	end
end

_G.GuiLoaded = true

if (shouldRemove) then
	script:Destroy()
end
