So I tried this to open and close my shop GUI, ~~~~~~~~~~~~~~~~~
Box = script.Parent.Box --Frame Button = script.Parent.OpenAndClose --TextBox Open = false Button.MouseButton1Down:connect(function(open) if Open == false then Button.Text = "Close" Box.Visible = true esleif Open == true then Button.Text ="Open" Box.Visible = false Open = false end end)
~~~~~~~~~~~~~~~~~
but it didn't do anything, what's wrong with the script, or is it not in the part it should be in? Is it old, not supported in newer roblox? Here's the Output: 15:49:20.063 - Players.Player1.PlayerGui.ScreenGui.LocalScript:9: '=' expected near 'Open' Sorry, i'm new to scripting on roblox, so i'm not experienced.
I have absolutely no idea if this question is answered or not but here's a few steps;
Make sure you have your object's in this order; ScreenGui
Inside of ScreenGui Frame --ShopFrame
Inside of Frame What you need to make your shop.
I'm not sure where you placed your button but if it's not inside of frame and instead beside frame so frame and button both have ScreenGui as parent then add a local script to the button and use this code;
local button = script.Parent local Opened = false local ShopFrame = button.Parent:WaitForChild("Frame") --Make sure you have the exact name in here button.MouseButton1Down:connect(function() if Opened == false then button.Text = "Close" ShopFrame.Visible = true else Opened = false button.Text = "Open" ShopFrame.Visible = false end end)
The error meant = sign is expected near the word "Open"
Please comment if you have any questions, otherwise, please accept answer and upvote.