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

My Shop won't open when I click on it? Please help, the game is FE.

My GUI doesn't work in-game when I click on it, FE is enabled btw. Here's the script:

local Button1 = script.Parent.Parent
local Button2 = script.Parent.Parent
Frame = game.StarterGui.ScreenGui.ShopMenu

function onClick()
if Frame.Visible == false then
Frame.Visible = true
elseif Frame.Visible == true then
Frame.Visible = false
end
end

Button1.MouseButton1Click:connect(onClick)



print("Worked")

If you need anything else, please comment and i'll respond, thanks!

3 comments

0

You don’t use StarterGui. You use PlayerGui.

0

What does FE mean?

0

FE means filter enabled

2 answers

###You should be using PlayerGui to get the frame. Not StarterGui.

###You also don’t need any if statements to check the Visible property.

-- LocalScript

local plr = game:GetService("Players").LocalPlayer
local plrGui = plr:WaitForChild"PlayerGui"
local frame = plrGui.ScreenGui.ShopMenu

script.Parent.Parent.MouseButton1Click:Connect(function()
    frame.Visible = not frame.Visible
end)

###On a side note, you should switch to Connect as ROBLOX may remove connect soon.

2 comments

0

Thanks for your response, but it still doesn't work? Do you want me to send you the properties of the menu? The script seems good, but it doesn't work for some reason.

0

line 4 should be local plrGui = plr:WaitForChild("PlayerGui")

Try this script:


local Frame = game.StarterGui.ScreenGui.ShopMenu
local enabled = false

function onClick()
if Enabled == false then
Enabled = true
Frame.Visible = true
else
Frame.Visible = false
Enabled = falsw
end
end

Button1.MouseButton1Click:connect(onClick)



print("Worked")

You have to put this in local script

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