#Open shopmenu button not working

83 messages · Page 1 of 1 (latest)

whole reef
toxic maple
#

y are there so many checks

#

@whole reef u here?

whole reef
#

yes

toxic maple
#

send that script real quick

whole reef
#

k

toxic maple
#

its better to make frame unvisible then to disable the whole screengui

whole reef
#

1 sec

#

that was not intended

#

local OpenButton = script.Parent

if OpenButton then
local Sound = OpenButton:FindFirstChild("Sound")
if Sound and Sound:IsA("Sound") then
OpenButton.MouseButton1Click:Connect(function()
Sound:Play()
local shopmenu = script.Parent.Parent:FindFirstChild("ShopMenu")
if shopmenu then
shopmenu.Enabled = true
end
end)
end
end

toxic maple
#

all g

whole reef
#

There ya go

toxic maple
#
local OpenButton = script.Parent
local shopmenu = script.Parent.Parent:FindFirstChild("ShopMenu")
    local Sound = OpenButton:FindFirstChild("Sound")
OpenButton.MouseButton1Click:Connect(function()
    if Sound:IsA("Sound") then
            Sound:Play()
        if shopmenu.Enabled == false then
           shopmenu.Enabled = true else                            shopmenu.Enabled = false
        end
    end
end)
```  i added this 
        if shopmenu.Enabled == false then
           shopmenu.Enabled = true else                            shopmenu.Enabled = false
which basically if the gui is open and u press the same button the gui will close and if its closed and u press it will open but if u want to u can just remove == false and do if shopmenu then shopmenu.Enabled = true
whole reef
#

So should i replace the script with this?

toxic maple
#

yup

#

that should work

whole reef
toxic maple
#

1s

toxic maple
#

is it a frame

#

or the whole screengui

whole reef
#

Shop menu is the entire screen gui

toxic maple
#

try this

local OpenButton = script.Parent

OpenButton.MouseButton1Click:Connect(function()
local shopmenu = script.Parent.Parent:FindFirstChild("ShopMenu")
    local Sound = OpenButton:FindFirstChild("Sound")
    if Sound:IsA("Sound") then
            Sound:Play()
        if shopmenu.Enabled == false then
           shopmenu.Enabled = true else                            shopmenu.Enabled = false
        end
    end
end)

#

try this

#

and lmk if it gives

#

the same error

whole reef
#

yup same error

toxic maple
#

ok its cause

#

ur looking for a shopmenu

#

in a shopmenu

#

do this

#

local OpenButton = script.Parent
local shopmenu = script.Parent.Parent
local Sound = OpenButton:FindFirstChild("Sound")
OpenButton.MouseButton1Click:Connect(function()
if Sound:IsA("Sound") then
Sound:Play()
if shopmenu.Enabled == false then
shopmenu.Enabled = true else shopmenu.Enabled = false
end
end
end)

#

this should work

whole reef
#

no error but it hid the open shop button

toxic maple
#

yeah cause

whole reef
#

and didnt

toxic maple
#

ur turning off the whole screen gui

whole reef
#

open

toxic maple
#

and the button is in there

whole reef
#

the menu

toxic maple
#

ok setup ur shop menu like this

#

in the screen gui

whole reef
#

No theyre 2 diffrent screen guis

toxic maple
#

make a frame

#

what

whole reef
toxic maple
#

so

#

button is in shopbutton

#

and shopmenu is diff ok

whole reef
#

yes

toxic maple
#
local OpenButton = script.Parent
local shopmenu = script.Parent.Parent.Parent:FindFirstChild("ShopMenu")
    local Sound = OpenButton:FindFirstChild("Sound")
OpenButton.MouseButton1Click:Connect(function()
    if Sound:IsA("Sound") then
            Sound:Play()
        if shopmenu.Enabled == false then
           shopmenu.Enabled = true else                            shopmenu.Enabled = false
        end
    end
end)
#

try this?

whole reef
#

Same first error

toxic maple
#

can u show me

#

the setup

#

of button

whole reef
#

k

toxic maple
#

just show me where this script is located

#

ok

whole reef
#

it is in starter gui

toxic maple
#

local OpenButton = script.Parent
local shopmenu = script.Parent.Parent.Parent:WaitForChild("ShopMenu")
local Sound = OpenButton:FindFirstChild("Sound")
OpenButton.MouseButton1Click:Connect(function()
if Sound:IsA("Sound") then
Sound:Play()
if shopmenu.Enabled == false then
shopmenu.Enabled = true else shopmenu.Enabled = false
end
end
end)

#

do this if its the same error

whole reef
#

omg i wuw u

#

bro thank you so much

toxic maple
#

works?

#

np

whole reef
#

I stg i was about to kill myself

#

THankkkkkk yuuuuuu

#

ayo can i add ya

toxic maple
#

np :D

whole reef
#

you seem like a nice fellow

toxic maple
#

sure ig im going to sleep rn tho :D

whole reef
#

Okay where r u form=

#

from?

toxic maple
#

georgia

#

country

whole reef
#

Ah k

#

Well goodnight

toxic maple
#

ty goodluck coding!