local lp = game.Players.LocalPlayer
local character = lp.Character or lp.CharacterAdded:wait()
character:WaitForChild("Humanoid").Died:Connect(function()
	print("player died")
	local frame = lp:WaitForChild("PlayerGui").WastedGui.TweenedFrame
	frame:TweenPosition(UDim2.new({0, 0},{.5, -75}), 'Out', 'Quad', 1)
	wait(4)
	frame:TweenPosition(UDim2.new({0, 0},{-1, -75}), 'Out', 'Quad', 1)
end)

this script only works the first time the player dies.

8 comments

0

Where is the script located? Also, don't use curly brackets in your UDim2.new()

0

It's located in StarterGui.WastedGui.TweenedFrame.Wasted.LocalScript

1

Did you turn off the "ResetOnSpawn" bool on the ScreenGui? You also don't need to reference PlayerGui, just use Parents.

0

ResetOnSpawn is enabled, do I turn it off?

0

No, it should be checked. What does the output say? Apart from the curly brackets and maybe your frame variable pointing to the wrong location, it works fine.

0

GUI only appears on the first death still, script only prints "player died" in the output the first time as well (fixed the curly bracket and used script.Parent.Parent for frame)

0

Why don't you add a line between 2 &3, and put 'character:WaitForChild("Humanoid")', then on line 3, which is now 4, try 'character.Humanoid.Died:Connect(function()'

0

Same result.