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
menuValuesSet.OnClientEvent:Connect(function(cutsceneComplete)
if cutsceneComplete == false then
--Code cut out due to not being related to the topic
else
print("Value is not false, skipping loading")
cutsceneEnd:FireServer(player)
GUI:Destroy()
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")
end
end)
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