I have made an Open/Close a GUI button for my Shop GUI. For some reason, when I click the button in studio it opens the frame. In-game and in team test it does not. Please help. This is the code I used:
local Button = script.Parent
Box = script.Parent.Parent.ScrollingFrame
function onClick()
if Box.Visible == false then
Box.Visible = true
elseif Box.Visible == true then
Box.Visible = false
end
end
Button.MouseButton1Click:connect(onClick)

3 comments
is this in a server script?
It is in a regular script inside a TextButton.
Put it in a localscript