Unknowingly, you used recursion which silenced the error. This is a very awkward script just reading it, I will attempt to help you however.
Your script (For reference):
function Track(Humanoid)
local Last = Humanoid.Health
local function HealthChanged(Left)
if Left < Last then
local Part = Humanoid.Parent:FindFirstChildWhichIsA("BasePart")
if Part then
wait(.1)
if HealthChanged then
return
else
wait(3)
label.Visible = false
end
end
Last = Left
end
end
Humanoid.HealthChanged:connect(HealthChanged)
end
My edited script:
function Track(Humanoid)
local Last = Humanoid.Health
Humanoid.HealthChanged:Connect(function(health)
if health < Last then
Last = health
local Part = Humanoid.Parent:FindFirstChildWhichIsA("BasePart")
if Part then
local label = script.Parent
label.Visible = false
end
end
end)
end
Note: One concern is that I'm not sure why you added
"if HealthChanged", I'm just assuming you tried to detect when the health changed and forgot it was already being monitored.
Also, back early to what I said about recursion, if that actually ran which it didn't because no parameter was inputted, it would have reached the maximum frames in no time and you would have crashed.
Also make sure you call Track(humanoid) somewhere in the script so it actually begins monitoring the health changes.
1 comment
Also when other player do damage, i see their damage, strange when its a local script and i want the player to see it only them and their humanoid damage, not others.