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

Exit button GUI won't dissappear in lobby?

Asked by 4 years ago
Edited 4 years ago

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)
0
Lines 5-9 can be replaced with `frame.Visible = false` alone. What do you want? programmerHere 371 — 4y
0
in line 5, make it true not false Gingerely 245 — 4y
0
@programmerHere, i dont quite understand what you mean. im trying to have it not pop up on screen until i access the certain area. RealKyklops 4 — 4y
0
@Gingerely, tried that. It still showed up when i joined. RealKyklops 4 — 4y
0
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. RealKyklops 4 — 4y

1 answer

Log in to vote
1
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago

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)
Ad

Answer this question