I've looked at all kinds of melee weapons and they either use bullets or tracehullattack which doesn't seem to make this work.
I need a melee weapon that I can detect it's DamageType with the EntityTakeDamage hook with damageinfo. The actual HL2 crowbar does it so I know it must be possible.
Edit* I meant detect the DamageType as a CLUB or a SLASH
Use [url=http://wiki.garrysmod.com/?title=G.DamageInfo]DamageInfo()[/url] to set up all the information for the damage you are going to deal. Then use a trace and [url=http://wiki.garrysmod.com/?title=Entity.TakeDamageInfo]Entity.TakeDamageInfo()[/url] to damage the entity.
Thanks that worked, but there is one problem when I use this, the ScaleNPCDamage hook doesn't get called.
[QUOTE=-TB-;18016186]Thanks that worked, but there is one problem when I use this, the ScaleNPCDamage hook doesn't get called.[/QUOTE]
Really? Weird. Anyway nothing's stopping you from calling it yourself.
[url]http://wiki.garrysmod.com/?title=hook.Call[/url]
Oh yeah thanks (= though I don't know how to specify the hitgroup, but I don't think I really need it in this case.
Oh I see what you mean. For applying the damage try shooting a bullet at the NPC where the trace hit it. That will call all hooks the regular way. Note it doesn't have to be an actual bullet with a tracer, sound and visuals.
[editline]11:07PM[/editline]
Actually I just found this in the wiki, might be useful : [url]http://wiki.garrysmod.com/?title=Entity.DispatchTraceAttack[/url]
Sorry, you need to Log In to post a reply to this thread.