I am making a localscript that is supposed to make the screen read on death, but when I try to check HealthChanged, it gives me this error.
Players.Uniplier.PlayerGui.Death.Death:3: attempt to index nil with 'FindFirstChild'
Here is my code.
local player = game:GetService("Players").LocalPlayer
local char = player:FindFirstChild("Character")
char:FindFirstChild("Humanoid").HealthChanged:Connect(function()
if char.charactervalues.Grabbed.Value == true then
local death = script.Parent.Frame
if char.Humanoid.Health <= 1 then
death.Transparency = 0
end
end
end)

1 comment
Where is this script placed and is this script suppose to open a gui frame??