local choosegui = PickModeGui
or
local choosegui = "PickModeGui"
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
The script doesn’t recognise "pcGui"
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
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.
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