Darkrp Help

-snips-

-snip-

-snip- Use code_gs’ code. Tested and works.

I happened to find a script in my files that I wrote a while ago. Try this:


hook.Add("EntityTakeDamage", "PropDamage", function (target, dmginfo)
    local attacker = dmginfo:GetAttacker()
    if not attacker:IsPlayer() and not dmginfo:IsFallDamage() and dmginfo:GetDamageType() == DMG_CRUSH then
        dmginfo:ScaleDamage(0)
    end
end)

Got any code that makes it so vehicles dont kill you when you run over someone ?

Modified the last script. Try this:


hook.Add("EntityTakeDamage", "PropAndVehicleDamage", function (target, dmginfo)
    local attacker = dmginfo:GetAttacker()
    -- Prop
    if not attacker:IsPlayer() and not dmginfo:IsFallDamage() and dmginfo:GetDamageType() == DMG_CRUSH then
        dmginfo:ScaleDamage(0)
    end
    -- Vehicle
    if target:IsPlayer() and (attacker:IsVehicle() or dmginfo:GetDamageType() == DMG_VEHICLE) then
        dmginfo:ScaleDamage(0)
    end
end)