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

Why wont this local script work?

Asked by 9 years ago

I am trying to make a GUI that closes and opens. I am inserting this into the actual button, which would toggle it. It looks like this: >Frame TextLabel

Buttons frame Button Local script All of this is inside of a Screen GUI. If you don't understand the diagram above, please tell me and I will explain it! Also should the Screen GUI be visible when the player joins, or not?

` local frame = script.Parent.Parent:WaitForChild('Frame') script.Parent.MouseButton1Click:connect(function() frame.Visible = not frame.Visible

end)`

0
frame.Visible and after is its own line..sorry!(Minus the space and end) iiAstroApple 30 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

MouseButton1Click is usually used with Scripts. MouseButton1Down, however, is used for LocalScripts. Just change the two and it should work.

local frame=script.Parent.Parent:WaitForChild("Frame")

script.Parent.MouseButton1Down:connect(function()
    frame.Visible=not frame.Visible.
end)
Ad

Answer this question