Quick fix for weapon spawn

I need a quick fix for a problem I’m having with people abusing pointshop permaweapons to span an arsenal
http://forum.facepunch.com/showthread.php?t=1302565

on this thread I just need someone to tell me how I can make the weapon damage someone for 50 health when they pick up the weapon.
here is the psuedocode:



function ITEM:OnEquip(ply)
--mystery code to take 50 health
	ply:Give(self.WeaponClass)
	ply:SelectWeapon(self.WeaponClass)
end


A quick messy fix until I can get this completely corrected.

ply:SetHealth(50)

unfortunately it works only one time

Take their current health and subtract 50, then set their health to that number.

Of course you need to do some checks to make sure you don’t set their health to something like -30.

[lua] function ITEM:OnEquip(ply)
local hp = ply:GetHealth()
if hp < 51 then
ply:Kill()
else newhp = hp - 50
ply:SetHealth(newhp)
end
– give weapon code
end
[/lua]

Sorry for the quality and shit, I’m on my phone currently

What this SHOULD do is:
Check if the hp is less than 51 and if it is, kills the player.
If the hp is above 50 then it takes away 50 hp