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)

5 comments
Lines 5-9 can be replaced with
frame.Visible = falsealone. What do you want?in line 5, make it true not false
@programmerHere, i dont quite understand what you mean. im trying to have it not pop up on screen until i access the certain area.
@Gingerely, tried that. It still showed up when i joined.
I understand i might have to go in depth a little, i'm trying to make it so that the exit button (the gui) pops up as soon as the player enters the vehicle allowing him to get out of the vehicle. but i dont want the gui to be on screen whilst the player isn't in the vehicle.