Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Gui works only in roblox studio,but he don't work in roblox server. What i have to do?

Asked by 6 years ago

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.

1
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. Tripyfy 28 — 6y
1
Thank you for help now it's working. I did it in script, not in Local script. Yakubovsky69 5 — 6y
0
In line 4 on MouseButton1Down, it has no parameters. User#19524 175 — 6y
1
2 things cound your parents 2 in the first script 3 in the second and use :Connect :connect is deprecated mattchew1010 396 — 6y

1 answer

Log in to vote
-1
Answered by
Tripyfy 28
6 years ago

Try this local script (be sure it's a local script and not a normal script):

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Parent.Visible = not script.Parent.Parent.Parent.Visible
end)

It should work, I haven't tested it out.

Ad

Answer this question