[URGENT!] GUIs not showing up on mobile

Hello, I was creating a shop gui, but looks like that when I click the open button on mobile it won’t show up. This is the script that I put into the open button:

local open = script.Parent.Parent.Shop
local click = script.Parent

click.MouseButton1Click:Connect(function()
	open.Visible = true
end)

Well first of all, what is “open”

I corrected it, but it still doesn’t works.

Defining everything without using script.Parent is common practice and much more useful when debugging code, especially on the devforums. Correct your code next time, or this time, because there’s no useful context we can take out of it.

You can do script.Parent.Parent.Shop.Visible = true

     ''''
              script.Parent.MouseButton1Click:Connect(function()
                    script.Parent.Parent.Shop.Visible = true
              end)
            '''

Still doesn’t works…[30]…

can you show the output when it doesn’t work?

Is there an error???

I don’t know, I am using your script but even if I click it doesn’t works, this looks so weird…

Only on mobile, tho…

Use the WaitForChild method, as the GuiObjects may not be loaded in immediately when the player joins the game.

local open = script.Parent.Parent:WaitForChild("Shop")

You can also try using the .MouseButton1Down or .Activated events instead of MouseButton1Click, not entirely sure if that one works on mobile.

5 Likes

What is click? (30charrrssssss)

Try putting a wait(3) seconds all the way at the top.

@SubbIezHolder If this is in a UI this needs to be a local script and for buttons to work on mobile you should use

click.activated:connect(function()
end)