I am currently developing a new user interface for my game, called Global Rails: Revolution, and I have run into a problem that I cannot seem to fix.
In the image above, you can see the “SYSTEM_BOOT” script, which hides a few items from the CoreGui and corrects the visibility of multiple UI items, as well as a variety of frames and a configuration folder. The frame in question is the one named “MarketMenu”, which is essentially a confirmation screen that the user will see upon clicking the “Marketplace” button on the title screen.
Upon playing the game, the error above is shown in the output window. In the “SYSTEM_BOOT” script, line 34 is supposed to hide the “MarketMenu” frame that was was shown earlier, but according to the error, the frame does not exist. This is most perplexing, as the “SYSTEM_BOOT” script is the only set of code that refers to the “MarketMenu” frame, and it only tells the frame to hide itself.
The image above was taken after the game has been played, and as you can see, the “MarketMenu” frame ceases to exist, and this can be seen both in StarterGui and PlayerGui. The question is, what is happening here? I have attempted to use a different name for the frame, such as “ShopMenu”, using a different parent frame, and I have even tried this in an entirely different ScreenGui, without scripts, and it got deleted anyway. Below is the code contained in the “SYSTEM_BOOT” script.
--Variables--
local mainUI = script.Parent --Defines the ScreenGui
local starterGui = game:GetService("StarterGui") --Defines the StarterGui
local missionButtons = mainUI.MainFrameA.DriveMenu.MissionsMenu.RoutesMenu:GetChildren()
--Hides ROBLOX UI elements--
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat,false)
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,false)
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
--Show and hide UI elements--
mainUI.TopBar.Visible = true
mainUI.TitleScreen.Visible = false
mainUI.TermsOfService.Visible = true
mainUI.MainFrameA.Visible = false
mainUI.MainFrameA.DriveMenu.Visible = false
mainUI.MainFrameA.DriveMenu.FreeDriveMenu.Visible = false
mainUI.MainFrameA.DriveMenu.MissionsMenu.Visible = false
mainUI.MainFrameA.DriveMenu.MissionsMenu.RoutesMenu.CanvasPosition = Vector2.new(0, 0)
mainUI.MainFrameA.DriveMenu.MissionsMenu.PreviewImage.Image = "rbxassetid://5083206255"
mainUI.MainFrameA.DriveMenu.MissionsMenu.PreviewImage.Cover.Visible = true
mainUI.MainFrameA.DriveMenu.MissionsMenu.Description.Default.Visible = true
mainUI.MainFrameA.DriveMenu.MissionsMenu.Description.InternationalFreight.Visible = false
mainUI.MainFrameA.DriveMenu.MissionsMenu.Description.YouForgotTheJuice.Visible = false
mainUI.MainFrameA.DriveMenu.MissionsMenu.Description.AutorackExpedition.Visible = false
mainUI.MainFrameA.DriveMenu.MissionsMenu.Description.LateFreight.Visible = false
mainUI.MainFrameA.DriveMenu.MissionsMenu.Description.ContinueButton.Text = "N/A"
for i, v in pairs(missionButtons) do
v.BorderColor3 = Color3.new(0.0941176, 0.0941176, 0.0941176)
end
mainUI.MainFrameA.DriveMenu.WarningScreen.Visible = false
mainUI.MainFrameA.ExploreMenu.Visible = false
mainUI.MainFrameB.Visible = false
mainUI.MainFrameB.MarketMenu.Visible = false
--Conditionals--
if mainUI.Configuration.IsGametest.Value == true then
mainUI.TermsOfService.MainFrame.DescriptionGT.Visible = true
mainUI.TermsOfService.MainFrame.DescriptionPG.Visible = false
mainUI.TitleScreen.Background.Image.ExitButton.Visible = true
else
mainUI.TermsOfService.MainFrame.DescriptionGT.Visible = false
mainUI.TermsOfService.MainFrame.DescriptionPG.Visible = true
mainUI.TitleScreen.Background.Image.ExitButton.Visible = false
end
Any and all help is appreciated, thanks!