attempting to change team damages need some help

OK, building a game mode where players on the same team do only a small amount of team damage to players on same team.

and in addition one team Neutral team is god-moded and on the off-chance they get a weapon somehow I wanted them to do 0 damage with it.

I’m getting some odd results using what we came up with, anyone got something better?

[lua]function GM:ScalePlayerDamage(ply, hitgroup, dmginfo)
if dmginfo:GetAttacker():IsPlayer() then
local attacker = dmginfo:GetAttacker()
if attacker:Team() == ply:Team() then
if dmginfo:GetDamage() > 20 then
elseif attacker:Team() == TEAM_NEUTRAL then
dmginfo:ScaleDamage(0)–this is not 0 but is doing only 10damage per shot

(ignore comment, this bit is normal damage, we were testing with a gun that does 10 damage :stuck_out_tongue: )