Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my GUI not clickable in play mode?

Asked by
Seyfert 90
8 years ago
Edited 8 years ago

My GUI works/operates fine in studio mode but in play mode it is not working correctly. my GUI consists of a clickable screenGUI button that will bring up a much bigger GUI. In play mode, the first clickable screenGUI appears on my screen, however I am unable to click on it. I can click on it in STUDIO mode. Here is my code.

This script clones the "ScreenGUI" which is in ServerStorage to PlayerGUI in each player

game.Players.PlayerAdded:connect(function(plr)
game.ServerStorage.ScreenGui:clone().Parent = plr.PlayerGui 
end)

This is the code in my clickable screenGui that works in studio mode but not play mode (it is a LocalScript)

local imageButton = script.Parent
local menu = script.Parent.Parent.Frame
local close = script.Parent.Parent.TextButton
Open = false

imageButton.MouseButton1Click:connect(function()
    if Open == false then
    Open = true
    imageButton.Image = "rbxassetid://"
    wait(0.1)
    imageButton.Image = "rbxassetid://"
    imageButton.Visible = false
    menu.Visible = true
    close.Visible = true
    elseif Open == true then
    wait(0.2)
    Open = false    
    end
end)

3 answers

Log in to vote
0
Answered by 8 years ago

Try changing MouseButton1Click to MouseButton1Down on Line 06.

0
Thank you for the reply. Changing it from MouseButton1Click to MouseButton1Down did not fix the issue, sadly. Any other ideas? Seyfert 90 — 8y
0
I am getting a bunch of diagnostics in the output view in play mode. I will try to take a look at those and report back Seyfert 90 — 8y
0
Ahh, one issue I just realized is apparently GUIs can not be in ServerStorage but in ReplicatedStorage (probably having to do with the way roblox handles client/server things). Seyfert 90 — 8y
Ad
Log in to vote
0
Answered by
Seyfert 90
8 years ago

Okay, I keep getting "Frame is not a valid member of ScreenGUI" however it is. If you look at my code above, it is correctly referring to the Frame.

0
Can you send a picture of the explorer Warfaresh0t 414 — 8y
Log in to vote
0
Answered by 8 years ago

Are you missing an end at the end? The first one being for the if statement, the second for the elseif and the third for the function with the closing bracket which I can see you already have..

Answer this question