Hello everyone! i'm making a sort of Camping like game and whilst in the lobby i have 2 cars and a button which reads exit. i dont want the button to be there until i am in the car itself. my script doesnt work and the exit button stays and dissapears once u click it so u cant use it afterwards again. help please? thank you!
local frame = script.Parent.Parent.Parent.Frame local open = false script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = false else frame.Visible = false end end)
Make sure you are using a local script. Also, the reason why it’s not working is cause you need to change false to true on line 6. Here’s a working script.
local frame = script.Parent.Parent.Parent.Frame local open = false script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = true else frame.Visible = false end end)