This is my script, line 6 is what the output complains about
for i, v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == BrickColor.new("Bright red") then
if v:FindFirstChild("PlayerGui") then
v.Character.Humanoid.HealthChanged:connect(function()
print("Boss Health Changed")
v.PlayerGui.BossHealth.Healthbar.LocalScript.RemoteEvent:FireClient()
print('Fired')
end)
end
end
end
I created this script so that if someone's health from the Bright red team is altered/changed (by use of that HealthChanged function) it is going to fire a remote event to the client. Why is it saying the argument is nil?

1 comment
Please Accept my Answer