Hello, friends!
Today I was trying to create a computer GUI, but when I went to create a command that went back to the main menu, it didn’t work and instead made a different GUI frame visible.
I think this may be a bug, but I’m not able to post in bug reports, and I don’t know how to fix it.
I’ve checked multiple times, and nowhere in the script does it have “CoreController”.
EDIT: Problem is at the bottom!
local function MenuControl()
Menu.Visible = true
BootBar.Text = ""
for i, v in pairs(StartScreen:GetChildren()) do
if v.Visible == false then else
v.Visible = false
end
end
for i,v in pairs(Menu:GetChildren()) do
v.Visible = true
end
end
CommandBar.FocusLost:Connect(function(enterPressed, inputObject)
local result
if enterPressed then
if CommandBar.Text:lower() == "disablelasers" or CommandBar.Text:lower() == "deactivatelasers" then
CommandPrompt.CommandArea["1"].Text = "> Enabling lasers."
for i, v in pairs(game.Workspace.CoreStuff:GetChildren()) do
if v.Name ~= "Core" then
if v:GetAttribute("OnLaser") == false then
result = false
CommandPrompt.CommandArea["1"].Text = "> LASERS ARE OFF."
else
result = true
CommandPrompt.CommandArea["1"].Text = "> Completed laser disabling."
end
wait(2)
end
end
if result == false then
ChangeLaser:FireServer(CommandBar.Text)
end
elseif CommandBar.Text:lower() == "enablelasers" or CommandBar.Text:lower() == "activatelasers" then
CommandPrompt.CommandArea["1"].Text = "> Enabling lasers."
for i, v in pairs(game.Workspace.CoreStuff:GetChildren()) do
if v.Name ~= "Core" then
wait(2)
if v:GetAttribute("OnLaser") == false then
result = false
CommandPrompt.CommandArea["1"].Text = "> LASERS ARE ON."
else
result = true
CommandPrompt.CommandArea["1"].Text = "> Completed laser disabling."
end
wait(1)
end
end
if result == true then
ChangeLaser:FireServer(CommandBar.Text)
end
elseif CommandBar.Text:lower() == "back" or CommandBar.Text:lower() == "cancel" then
CommandPrompt.Visible = false
MenuControl() -- Main issue!
end
end
game:GetService("RunService").RenderStepped:Wait()
CommandBar:CaptureFocus()
end)
sorry if this is hard to understand, i’m not that good at scripting lol