I made a GUI that pops up from outside the screen when a player dies but it shows this error when I die and doesn't work. Attempt to index nil with 'Died' I tried to change it to a server script but it showed the same error again so I put it back in a LocalScript.
Erroring line
Line 6
local frame = script.Parent.Frame
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:FindFirstChild("Humanoid")
humanoid.Died:Connect(function()
frame:TweenPosition(
UDim.new(0.256, 0,0.075, 0),
"Out",
"Quad",
0.5,
false
)
wait(3.5)
frame:TweenPosition(
UDim.new(0.256, 0,-1.075, 0),
"Out",
"Quad",
0.5,
false
)
end)
LocalScript is stored inside of the ScreenGUI
ty if u helped

1 comment
Thanks this helped now it works :D