Why does ui show back up even when the property Reset on Spawn is false. And why does animation stop working

Check the video

https://gyazo.com/1a9ee645d334a652e9503aa928737f4d

(I can send some more code if you need)
This is my second time posting this I really need help with this

local module = require(script.ClassSelection)
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local Hum = Char:WaitForChild("Humanoid")
local ClassSelectionFolder = Player.PlayerGui.ClassSelectionUI
local CurrentClassFolder = ClassSelectionFolder.Classes
local ClassText = ClassSelectionFolder.SelectionScreen.Frame.TextLabel
local PlayButton = ClassSelectionFolder.SelectionScreen:WaitForChild("Frame").TextButton
local ClassSelected = ""


Char:GetAttributeChangedSignal("Class"):Connect(function()
	print("Sup")
end)

module:ChoosenClass(CurrentClassFolder,ClassSelected,ClassText)
module:Start(PlayButton,Char)
--!nocheck
local Player = game.Players.LocalPlayer
local PlayerUi = Player.PlayerGui
local ClassSelectionFolder = PlayerUi:WaitForChild("ClassSelectionUI")
local ClassSelected = ""
local DB = false
local Table = {}

local module = {}


function module:ChoosenClass(ClassFolder:Folder,SelectedClass:string,SelectionScreenText)
	for i,v in ClassFolder:GetChildren() do
		if v.ClassName == "ImageButton" then
			v.MouseButton1Click:Connect(function()
				for ii,vv in v:GetChildren() do
					if vv.ClassName == "TextLabel" then
						SelectedClass = vv.Text
						SelectionScreenText.Text =  SelectedClass 
					end
				end
			end)
		end
	end
end


function module:Start(PlayButton,Char)
PlayerUi.ChildAdded:Connect(function()
	print("Sup")
end)
	PlayButton.MouseButton1Click:Connect(function()
		if DB == true then ClassSelectionFolder:Destroy() end
		if ClassSelectionFolder.SelectionScreen.Frame.TextLabel.Text ~= "Choosen Class:" and not DB then
			DB = true
			Char:SetAttribute("Class",ClassSelectionFolder.SelectionScreen.Frame.TextLabel.Text)
				ClassSelectionFolder:Destroy()
		end
	
	end)
	


end


return module

i aint no expert but did you put the local script in startercharacterscript because there’s a difference between startercharacterscript and starterplayerscript for an example:

StarterCharacterScripts are for storing scripts in the Player’s character when they join the game

StarterPlayerScripts are for storing local scripts to the Player once they have joined the game

startercharacterscript is like every time the player resets or something
and starterplayerscript is for like once he JOINS

if that didn’t work then tbh am not the guy for this-

There where in starter character scripts I just did the switch lemme see what happens.

It did not work but thanks for the help I actullay learned something from what you just told me.

ahh i see, sorry i wasn’t much of a help am kinda of a starter scripter myself glad that i atleast teached you something

hey am back and i figured it out do you still need help with it?

I fixed it but I would like to here what you have to say to see if are solutions are similar

it’s like super simple it was like a click only in the properties menu when you click on ur screen gui you can enable and disable resetonspawn

It’s strange, but I encountered and resolved this bug myself a while back. ScreenGui.ResetOnSpawn is only respected when the ScreenGui is a direct child of the “PlayerGui” folder. I suspect this is because Roblox uses Instance:GetChildren on that folder to search for any ScreenGui instances that it should keep. Looking at your code, it seems your ScreenGui is a child of a folder in PlayerGui, not a child of PlayerGui itself. You will need to remove that folder.

FYI,

“Choosen” is spelt “chosen”

Thanks alot with this information