Humanoid.Died in a Non-Character

In my game, there are walls which use Humanoids so that you can deal damage and break them
This works perfectly fine, but the way to destroy them consist of using “Humanoid.HealthChanged” and then checking if the Humanoid.Health is less or equal to 0

Now this works fine also, but in a server with over thousands of walls placed, it takes a toll on performance when that event fires every second to heal every wall

I tried using the Humanoid.Died function, but it doesnt fire, even though the Walls have a Humanoid Inside of them

Someone help?

It would be better if you had your own health system, like just a key that points to the building’s health.

Humanoid.Died is not a function. Maybe this forum post could help.

Also, I agree with @bytesleuth. You should make your own health system.

Wdym my own health system? Like with NumberValues instead of a Humanoid?

You are using Humanoids for health. You should make your own health mechanic for the walls, without using humanoids. Also, If you want to get rid of old walls to solve some performance issues, you can use the :AddItem() method of Debris.

1 Like