How do you tween a GUI into the screen then back off?
I have a part that if touched, awards the player who touched it some cash. I am stuck trying to tween the GUI I have made onto the screen then back of again. Please help!!!
05 | local gui = game.StarterGui.ParkourCompleted.Main |
08 | function onTouched(hit) |
12 | local check = hit.Parent:FindFirstChild( "Humanoid" ) |
16 | local user = game.Players:GetPlayerFromCharacter(hit.Parent) |
17 | local stats = user:WaitForChild( "leaderstats" ) |
20 | local cash = stats:findFirstChild( "Cash" ) |
21 | cash.Value = cash.Value + 100 |
22 | gui:TweenPosition(UDim 2. new( 0.306 , 0 , 0.395 , 0 )) |
24 | gui:TweenPosition(UDim 2. new( 0.247 , 0 ,- 10 , 0 )) |
35 | script.Parent.Touched:connect(onTouched) |