01 | if Input.KeyCode = = Enum.KeyCode.Q then -- Opening |
02 | script.Parent:TweenPosition( |
03 | UDim 2. new( 0 , 0 ,- 1 ), |
04 | "Out" , |
05 | "Quart" , |
06 | 2 , |
07 | false , |
08 | nil |
09 | ) |
10 | script.Parent.Visible = false |
11 | end |
If you can help, Thanks.
It instantly disappears as you haven't added any sort of wait or check to see if the tween has finished, try adding a check or wait such as:
01 | if Input.KeyCode = = Enum.KeyCode.Q then -- Opening |
02 | script.Parent:TweenPosition( |
03 | UDim 2. new( 0 , 0 ,- 1 ), |
04 | "Out" , |
05 | "Quart" , |
06 | 2 , |
07 | false , |
08 | nil |
09 | ) |
10 | wait( 5 ) -- not most accurate but you can change the wait time. |
11 | script.Parent.Visible = false |
12 | end |