I don't know if either I did the tweening wrong or something else like that, but the Gui showed before I added the tween and now with the tween it doesn't work. Here's my script:
01 | local gui = script.Parent.Parent |
02 | local player = game.Players.LocalPlayer |
03 |
04 | player.Character:WaitForChild( "Humanoid" ).Died:Connect( function () |
05 | wait( 2 ) |
06 | gui.Enabled = true |
07 | gui:TweenPosition(UDim 2. new( 0 , 0 , 0 , 0 ), Enum.EasingDirection.InOut, Enum.EasingStyle.Bounce) |
08 | wait( 3 ) |
09 | gui.Enabled = false |
10 | end ) |
SO, I do not think you can tween pos a screen gui, therefore ; Instead of doing script.Parent.Parent, make a frame and put everything in it. Make the fram visible = false and make sure the frame is the parent of the local script.
01 | local plr = game.Players.LocalPlayer |
02 | local hum = plr.Character:WaitForChild( "Humanoid" ) --// Waits until the player character loads and finds Humanoid |
03 | hum.Died:Connect( function () |
04 | local gui = script.Parent |
05 | if gui.Visible = = false then --// Checks if gui is already visible |
06 | gui.Visible = true |
07 | wait() --// The wait after you die |
08 | gui:TweenPosition(UDim 2. new( 0 , 0 , 0 , 0 ), Enum.EasingDirection.InOut, Enum.EasingStyle.Bounce) |
09 | wait( 3 ) --// Wait for the gui to be gone. |
10 | gui.Visible = false |
11 | end |
12 | end ) |