I have updated the code above and I have moved the old code to PasteBin, Also I have added another file called rdr_invis.lua its pretty much a copy of what ULX uses for invisibility, but this one will not give you any errors. (Look at the code to see what I mean.)
I am still looking for people to help me with this, I really don't want to post this on facepunch because I am afraid that people will steal it, so please just spread the word to people you think may be interested and together we can make this thing awesome.
Oh and the scores are kinda messed up, and they wont save.
---snip---
Here is the AntiPK code because some people where asking me for just the AntiPK code. (The damage to sender does not work yet but it will, after I update it.)
function antiPk( target, dmginfo )
if( dmginfo:GetDamageType() == DMG_CRUSH ) then
-- local atk = dmginfo:GetAttacker()
-- if( IsValid(atk) and atk:Alive() ) then
-- if(atk:Health() >= 1) then
-- atk:SetHealth(atk:Health() - dmginfo:GetDamage())
-- else
-- atk:Kill()
-- end
-- end
dmginfo:ScaleDamage( 0 )
end
end
hook.Add( "EntityTakeDamage", "antiPk", antiPk )