My Gui works only in roblox studio,but he don't work in roblox.
local frame = script.Parent.Parent.Box
local OpenClose = script.Parent.Parent.Open
local OpenClose = false
script.Parent.MouseButton1Down:connect(function(Open)
if OpenClose == false then
frame.Visible = true
OpenClose = true
elseif OpenClose == true then
frame.Visible = false
OpenClose = false
end
end)
So, this is code for some gui, when I test it it runs fine. But when I use regular servers outside of studio it doesn't work. I'm also try to use thus code
local frame = script.Parent.Parent.Parent:WaitForChild("Box")
script.Parent.MouseButton1Click:connect(function()
frame.Visible = not frame.Visible
end)
but this also doesn't work.

4 comments
First of all, make sure that the scripts are Local Scripts instead of normal Scripts, second, why local OpenClose has two meanings I mean, local OpenClose = script.Parent.Parent.Open and local OpenClose = false so you may change the last OpenClose to Close or FalseClose, change the name and it should work.
Thank you for help now it's working. I did it in script, not in Local script.
In line 4 on MouseButton1Down, it has no parameters.
2 things cound your parents 2 in the first script 3 in the second and use :Connect :connect is deprecated