ResetOnSpawn* set to false is not being honored

From one update to the next, ResetOnSpawn is no longer being honored. I have elements that are set to false, and I have scripts for my TopBarPlus and other elements that rely on grabbing the initial screen gui, then wiring into static or dynamically created elements. However on reset, those screengui are recreated or something is happening, and the buttons no longer work.

Here is a code example that worked flawlessly prior to one of the most recent updates

--
--
--

-- Setup
local ICON_BUTTON			= 105512384542974



-- Services
local player				= game:GetService( "Players" ).LocalPlayer
local collection_service	= game:GetService( "CollectionService" )
local replicated_storage    = game:GetService( "ReplicatedStorage" )

-- TopBarPlus
local container				= replicated_storage.Modules.TopbarPlus
local icon					= require( container.Icon )


-- Acecool
local Acecool				= replicated_storage:WaitForChild( "Acecool" )
local gui_manager			= require( Acecool.Modules.GuiManager )
local lib					= require( script.Parent.lib_topbar )




--
--
--
local gui					= player.PlayerGui:WaitForChild( "TopBar", 60 ):WaitForChild( "GuiGamePasses", 60 )
local frame					= gui:WaitForChild( "Frame" )


--
--
--
local menu = icon.new( )
	:setName( "SettingsMenu" )
	:align( "Right" )
	:setOrder( 200 )
lib:ApplyUIStroke( menu.widget )


--
-- Settings
--
local button = icon.new( )
	:setName( "GamePassesButton" )
	:setImage( ICON_BUTTON, "Deselected" )
	:align( "Right" )
	:oneClick( true )
	:setImageScale( 1, "Deselected" )
	:setOrder( 1 )



--
-- Setup the menu
--
menu:setFixedMenu( {
	button,
} )



collection_service:AddTag( button.widget, "GuiMouseOnHover" )


--
-- Monitor frame visibility changes
--
frame:GetPropertyChangedSignal( "Visible" ):Connect( function( )
	-- Rotate button based on visibility
	lib:RotateButton( button, frame.Visible and 90 or 0 )

	-- Play a sound and close all other Primary Gui on open
	if ( frame.Visible ) then
		lib:PlaySound( "MENU_OPEN" )
		gui_manager.CloseAllExcept( frame )
	end

end )



--
-- Toggle button
--
button:bindEvent( "deselected", function( self )
	frame.Visible		= not frame.Visible
end )

That works exactly as intended before death. On death, even though the ScreenGui is has ResetOnSpawn to false, it resets which breaks the “frame” reference. A quick test, in bindEvent re-reading frame fixes that, but that requires additional logic to disconnect, and connect the listeners each time which I am fine with doing but this bug still exists.

Expected behavior

I expect ResetOnSpawn to be honored so the scripts that rely on keeping a reference to a ScreenGui don’t break on death.

Here is an example - It worked like this before, even after death. But now with the update, after death you see it doesn’t work. I added a quick variable in frame.Visible = not frame.Visible to refetch frame and that is why the right middle button shows, but the animation doesn’t. Because those variables are being lost.

The AI Assistant said this:

For a game that has a LOT of different elements, not being allowed to use folders anymore for organization is ridiculous. If everything is at the top level that just makes a lot of problems.

Edit: It seems the AI is correct. Folders are deleted and recloned meaning screen guis CAN NOT honor ResetOnSpawn == false.

Everything being forced to be at the top level is a pretty big annoyance. I like having all of my modules in folders so if I move my inventory system to a new game I can copy the ReplicatedStorage, ServerScriptStorage and StarterGui bits. I would honestly prefer if modules could be loaded into a service that allows those services to be a child of those modules to make things easier, but now everything is going to look different.

My current solution is to create another screengui and have the other screenguis parented under it which looks ugly. But that solved the issue.

So originally I had InventorySystem, a folder as the root directory inside of StarterGui. Inside that was Scripts folder that should persist and the 3 screenguis which should reset on death.

Now, if I have the main one reset, everything resets. If I try setting the nested ScreenGuis to reset, then only the top one does, or it doesn’t honor it.

Basically this change broke the entire layout and is very frustrating.

what if you put the screengui to replicatedstorage wait for all descendants to replicate set resetonspawn to false and then clone it on clientside and parent it to playergui yourself without using startergui

resetonspawn is honored repro.rbxl (64.0 KB)

edit: actually cloning it is unnecessary you can just parent it to playergui since your changes on client won’t replicate to serverside

edit 2: whaaat this is such a non issue just move the InventorySystem folder to replicatedstorage on serverside so it doesn’t get reset (if it exists on serverside of course)

the logic right now might be confusing but i understand how it works is that anything you parent to playergui will reset on spawn unless you parented it under the screengui with resetonspawn set to false