Screen GUI won't follow :Destroy or .Enabled = false

What I want to achieve:
I am currently making a loading screen that destroys itself if the player resets after joining in, so that the players do not have to see the loading screen every time they reset.

What is the issue:
However it is not following the :Destroy() function and ignores when the .Enabled value is set to false.
The code is

local GUI = script.Parent
local text = GUI.Frame.LoadingText


	if cutsceneComplete == false then
		--Code cut out due to not being related to the topic
		print("Value is not false, skipping loading")
		print("If this appears, the GUI was not removed")
		GUI.Enabled = false
		print("If this shows up, and if the loading screen is still there, then the GUI was not disabled")

What solutions have I used:
As seen in the code of the script, I have used debug print statements, which function as intended, whereas the :Destroy function and .Enabled = false instruction do not work at all, as shown in the screenshot below

Are there any solutions to this situation? If so then please let me know

Thats easy to do! Just go on the ScreenGUI and disable “ResetOnSpawn”

1 Like

Thank you for letting me know about that, I have never known about that until now :slight_smile:
I am going to see if this works as intended

Edit: it works, thank you for the solution :+1: