| Blockland Forums > Modification Help |
| Body Parts |
| << < (2/3) > >> |
| Derroith:
Bump, I tried it out, but it doesnt kill on headshot. |
| Amade:
--- Quote from: Derroith on September 19, 2011, 09:30:50 PM ---Bump, I tried it out, but it doesnt kill on headshot. --- End quote --- What exactly did you try out? |
| Tezuni 2.0:
--- Code: ---package Headshot { function ProjectileData::damage(%this, %obj, %col, %fade, %pos, %normal){ %this2=%this; if(%col.getClassName()$="Player"){ if(getword(%pos,2)>getword(%col.getWorldBoxCenter(),2)-3.3){ %name = %this.GetName(); if(%name$="deagleProjectile"){ %this2=deagleheadshotprojectile; // %obj.emote(AlarmProjectile); // %obj.client.play2d(headshotSound); } } } return Parent::damage(%this2, %obj, %col, %fade, %pos, %normal); } }; ActivatePackage(Headshot); --- End code --- straight from stratofortress' deagle code |
| Nexus:
--- Quote from: Tezuni 2.0 on September 19, 2011, 11:29:15 PM --- --- Code: ---package Headshot { function ProjectileData::damage(%this, %obj, %col, %fade, %pos, %normal){ %this2=%this; if(%col.getClassName()$="Player"){ if(getword(%pos,2)>getword(%col.getWorldBoxCenter(),2)-3.3){ %name = %this.GetName(); if(%name$="deagleProjectile"){ %this2=deagleheadshotprojectile; // %obj.emote(AlarmProjectile); // %obj.client.play2d(headshotSound); } } } return Parent::damage(%this2, %obj, %col, %fade, %pos, %normal); } }; ActivatePackage(Headshot); --- End code --- straight from stratofortress' deagle code --- End quote --- This is the glitchy and inconsistent version (no support for crouching/sitting/other player sizes/buggy in the first place). I will see what I can do to find the actual function one that involves paint projectiles Edit: I couldnt find an example of a mod that utilized the paint projectile method, but I did find this in the TF2 weapon set that would improve the estimation of where the head is. --- Code: ---%colscale = getWord(%col.getScale(),2); if(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 3.3*%colscale) --- End code --- |
| Derroith:
--- Quote from: Amade on September 19, 2011, 10:59:07 PM ---What exactly did you try out? --- End quote --- Your SG code. --- Quote from: Nexus on September 19, 2011, 11:54:18 PM ---big snip --- End quote --- I will try this when I wake up in the morning. |
| Navigation |
| Message Index |
| Next page |
| Previous page |