I have made this GUI that would fade in pressing the Q button. The fade-in works, but I'm not sure how to make the same GUI fade out after pressing the same button.
Here's my script:
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
gui = script.Parent
box = gui.Box
Open = false
function PressQ(key)
if (key == "q") then
if (Open == false) then
box.Visible = true
for trna = 1,0,-0.1 do
box.BackgroundTransparency = trna
wait(.005)
end
Open = true
elseif (Open == true) then
box.Visible = false
for trna = 0,1,0.1 do
box.BackgroundTransparency = trna
wait(.005)
end
Open = false
end
end
end
Mouse.KeyDown:connect(PressQ)

2 comments
This helped! Thank you!
No Problem.