Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my GUI not clickable in play mode?

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

Try changing MouseButton1Click to MouseButton1Down on Line 06.

3 comments

0

Thank you for the reply. Changing it from MouseButton1Click to MouseButton1Down did not fix the issue, sadly. Any other ideas?

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

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).

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.

1 comment

0

Can you send a picture of the explorer

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..

This discussion is preserved as it was. New answers, comments, and votes are closed.