local A=true for O,s in ipairs(guis:GetChildren())do if s:IsA("\076\097\121\101\114\067\111\108\108\101\099\116\111\114")and s.ResetOnSpawn then A=false local O player.CharacterAdded:Connect(function()if O then O:Destroy()end O=s:Clone()O.Parent=playerGui end)else s.Parent=playerGui end end _G.GuiLoaded=true if A then script:Destroy()end

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
