#Open shopmenu button not working
83 messages · Page 1 of 1 (latest)
yes
send that script real quick
k
its better to make frame unvisible then to disable the whole screengui
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
all g
There ya go
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
So should i replace the script with this?
1s
Shop menu is the entire screen gui
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
yup same error
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
no error but it hid the open shop button
yeah cause
and didnt
ur turning off the whole screen gui
open
and the button is in there
the menu
No theyre 2 diffrent screen guis
yes
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?
Same first error
it is in starter gui
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
np :D
you seem like a nice fellow
sure ig im going to sleep rn tho :D
ty goodluck coding!