• Entity damage
    6 replies, posted
Hey, guys. I am using code for reduce damage from bullets with check. So, I have entity anomalies. How can I make damage check only for one entity/anomaly?
I have no idea what you are talking about, but you need a () after "IsBulletDamage"
Compare the callback entity to your desired entity
I need this, but for entity
Try this: [CODE]if SERVER then function Sykarabotai( target, dmginfo ) if ( target:IsPlayer() and dmginfo:IsBulletDamage() and target:GetModel() == "models/stalkertnb2/psz9d_duty2.mdl" ) then dmginfo:ScaleDamage( 0.048 ) end return true -- Without it the damages won't probably be registered end hook.Add("EntityTakeDamage","Sykarabotai",Sykarabotai) end[/CODE]
[QUOTE=xDShot;49116321]Try this: CODE[/QUOTE] Returning true completely blocks the damage event, for this it shouldn't return anything.
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/CTakeDamageInfo/GetAttacker]CTakeDamageInfo:GetAttacker[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/GetClass]Entity:GetClass[/url]
Sorry, you need to Log In to post a reply to this thread.