GUI Scripting Help

local choosegui = PickModeGui

or

local choosegui = "PickModeGui"

its more like

local choosegui = script.Parent

Because the localscript is parented to the choosegui. So it makes sense to do script.Parent

local pcgui = pcGui

image

The script doesn’t recognise "pcGui"

Capture4

robloxapp-20210311-1826080.wmv (1.5 MB)

Can you see the problem?

Its because you cant just put the name of the screengui.
This will work:

local pcgui = script.Parent.Parent.pcGui
local mobgui = script.Parent.Parent.mobileGui
local pc = pcgui.pcbutton
local mob = mobgui.mobbutton
1 Like
local choosegui = script.Parent
local pcgui = script.Parent.Parent.pcGui
local mobgui = script.Parent.Parent.mobileGui
local pc = pcgui.pcbutton
local mob = mobgui.mobbutton

pc.MouseButton1Click:Connect(function()
choosegui.Enabled = false
wait(0.1)
pcgui.Enabled = true
end)

mob.MouseButton1Click:Connect(function()
choosegui.Enabled = false
wait(0.1)
mobgui.Enabled = true
end)

The script is fine, but the Gui still won’t disappear.

1 Like

Open up the output window to see if any errors pop up, and if there is then just copy and paste the error message.

If there isnt any errors then just remove the wait()

pcGui is not a valid member of PlayerGui “Players.MathsKid7.PlayerGui” - Client - LocalScript:2

Start of script if needed:

local choosegui = script.Parent
	local pcgui = script.Parent.Parent.pcGui
	local mobgui = script.Parent.Parent.mobileGui
	local pc = pcgui.pcbutton
	local mob = mobgui.mobbutton

How do I solve this?

Rename ‘pcGui’ and ‘mobGui’ to ‘pcgui’ and ‘mobgui’ since in the script its lowercase. Or you can just change the g’s to be uppercase