All pastes #911895 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-02-21 00:05 UTC
rendered paste body

function NANOSUIT.EntityTakeDamage( Player, _, _, Amount, DmgInfo )

	if not Player:IsPlayer( ) then
		return DmgInfo
	end

	if Player:GetNanosuitMode( ) == MODE_ARMOUR then
		if Player:TakeNanosuitEnergy( Amount * 0.5 ) then
			DmgInfo:SetDamage( math.floor( DmgInfo:GetDamage( ) * 0.1 ) )
		end
		
		return DmgInfo
	end
	
end

hook.Add( "EntityTakeDamage", "NanosuitScaleDamage", NANOSUIT.EntityTakeDamage )