1. I'm looking for an example to basically give the players a message if they were hit by whatever damage. so if hit by bullet, wolf etc. I want it to show they have been hit and to popup a message. I've seen the
    OnEntityTakeDamage but not completely sure.
     
  2. Wulf

    Wulf Community Admin

    Take a look at plugins like Death Notes, the syntax isn't that different.
     
  3. Death Notes uses OnEntityDeath not OnEntityTakeDamage
     
  4. Wulf

    Wulf Community Admin

    Oh well, the below may help instead. :p
    Code:
    function PLUGIN:OnEntityTakeDamage(player, hitinfo)
        if player:GetComponent("BasePlayer") then
            if not hitinfo.damageTypes:find("DamageTypeList") or hitinfo.damageTypes:Total() <= 0 then
                return
            end        local damageType = hitinfo.damageTypes:GetMajorityDamageType()        if damageType:find("Fall") then
    Take it as an example, it's just a portion from one of mine locally.
     
  5. forgot 2 "end"s
     
  6. Wulf

    Wulf Community Admin

    No, I left them off as I only copied the portion at the start. ;)

    That's why I said to take it as an example, don't expect it to work without finishing it off.
     
  7. should add some .... to it then :p