*I've been trying to create a *ScreenGUI ** for when the players connect into my game that tells them some basic info, but for it to close the button has to be pressed multiple times and i'm not sure why!
I am a beginner and well..I don't know what to do.
--0-
local WelcomeGUI = true
local Button = script.Parent
local GUI = script.Parent.Parent.Parent.Frame
--0-
function CloseIt() --Start of the function
if WelcomeGUI == true then
GUI:TweenPosition(UDim2.new(0, 400,0, 200),"Out","Bounce")
wait(0.15)
WelcomeGUI = false
elseif WelcomeGUI == false then
GUI:TweenPosition(UDim2.new(0, 400,0, -200),"Out","Bounce")
wait(0.15)
WelcomeGUI = true
end
end
Button.MouseButton1Down:connect(CloseIt)
