Hey I currently help out a garrys mod server and i was wondering if anyone here could explain to me how i can add into the m9k weapon base for the damage to decrease over distance thanks for any support
yes the problem with this is the only way i cud think of doing is have a local scale and have it choose the math.max and .min but i can't figure out what zaaa formula would be :c
[editline]10th December 2015[/editline]
hello??
oh also i forgot to add....I am willing to pay. but it must be someone known in gmod community not out of.
[editline]10th December 2015[/editline]
What I have so far been forced to go with is this
function SWEP.ScaleDamage( ply, hitgroup, dmginfo )
if not SERVER or not dmginfo:IsBulletDamage() then return end
local att = dmginfo:GetAttacker()
if not att or not att:IsPlayer() then return end
local wep = att:GetActiveWeapon()
if not wep or wep:GetClass() ~= "m9k_aw50" then return end
local len = ply:GetPos():Distance( att:GetPos() )
local scale = math.min( math.max( 1.0, ( len - 141 ) * -1 ), 3.525 )
dmginfo:ScaleDamage( scale )
end
Sorry, you need to Log In to post a reply to this thread.