Universal weapons (Players, NPCs, Damaged objects)

Dear programmers. I can't solve one problem. I have a weapon that deals damage to the player and the damaged object. There are weapons that cause damage to the player and the NPC. But I can't put it all together. Maybe someone will help you write a universal script that causes damage to both players, NPCs and damaged objects? It is desirable that it acts on both small arms and rocket launchers. Thank you very much in advance.

If I understood correctly, then you want to make your own damageble object. I did not do this myself, because they introduced a standard one, and it was enough for me for my purposes. I suspect that for your purposes you need the "projectile" object and its "impact Event" event. Unfortunately, I don't have the opportunity to experiment right now (there are a lot of things to do in the project and very little free time for this). Perhaps someone more knowledgeable will tell you.
Or did I misunderstand your question?))

I solved the problem. Thanks anyway.

Thank you all, I managed it )))

Hey man can you please help me about the damagin to objects.

If I can, I can. And what exactly is needed?

I'm trying the creat an object tat has HP and when I fired with gun it will destroyed. I know there is a new update but I want to know how can I do it with lua. I searched for Tutorial and also I looked through the Core API Doc.. There are some type of code called damageble object. DamageableObject - Core Documentation and there is the link. I tried to use thouse codes but I couldn't figure it out :(... I just want to know how I can call thouse codes to make it objects can take damage.

I hope that was clear. I will really thankfull if you can give me a hand.

Peace man.