This may be complex. I'm trying to get this GUI script to be disabled until another script inside StarterGui is disabled. The problem is, whenever the script is disabled after I called the Disabled event, it prints "Waiting for the main script to be disabled" twice after MainbarScript is disabled.
EDIT: Fixed.
local MainBarScript = script.Parent:WaitForChild("MainBarScript")
---------------
local MGameText = script.Parent.MinigameGUI.MiniFrame.MinigameText
---------------
local MGameObject = script.Parent.MinigameGUI.MiniFrame.MinigameObj
---------------
local MGameCreator = script.Parent.MinigameGUI.MiniFrame.MinigameCreator
---------------
local MiniFrame = script.Parent.MinigameGUI.MiniFrame
---------------------------------------
--MINIGAMES FOLDER INFO--
local Minigames = game.ReplicatedStorage.Minigames:GetChildren()
---------------------------------------
if game.StarterGui.MainBarScript.Disabled == false then
print("Waiting for the main script to be disabled")
elseif game.StarterGui.MainBarScript.Disabled == true then
print("The main script is disabled. Ready to go.")
end

1 comment
Could we see what triggers the script to Disable?