I'm trying to make a gui that changes positions using the Tweenposition function but it only works once and won't work again until my player respawns.
Local script located in textbutton:
01 | local inuse = false |
02 |
03 | script.Parent.MouseButton 1 Click:connect( function () |
04 | if inuse = = false then |
05 | inuse = true |
06 | script.Parent.Parent:TweenPosition(UDim 2. new( 0 , 350 , 0 , 230 )) |
07 | wait( 1.5 ) |
08 | end |
09 |
10 | end ) |
11 |
12 | script.Parent.MouseButton 1 Click:connect( function () |
13 | if inuse = = true then |
14 | inuse = false |
15 | script.Parent.Parent:TweenPosition(UDim 2. new( 0 , 10 , 0 , 230 )) |
16 | wait( 1.5 ) |
17 | end |
18 |
19 | end ) |
Thanks!
01 | local inuse = false |
02 |
03 | script.Parent.MouseButton 1 Click:connect( function () |
04 | if inuse = = false then |
05 | inuse = true |
06 | script.Parent.Parent:TweenPosition(UDim 2. new( 0 , 350 , 0 , 230 )) |
07 | else |
08 | inuse = false |
09 | script.Parent.Parent:TweenPosition(UDim 2. new( 0 , 10 , 0 , 230 )) |
10 | end |
11 | end ) |