1. Hello,

    I'm trying to get the name of an entity when I use OnPlayerAttack(). I realized that hitinfo.HitEntity.Name returns "Name", but are there any unique names for each objects that I can use to check against?

    In truth; I'd like to know how I can check if the entity the player attacked was the airdrop supply crate entity. Any help solving this issue would be very helpful.

    Thanks
     
  2. Code:
    hitinfo.HitEntity.gameObject.name
    could work
    but it's not really like that that you want to do it.
    you want to do it by classes, like you want to see what class an entity has.
    for a player it would be:
    Code:
    if(hitinfo.HitEntity:GetComponentInParent(global.BasePlayer._type)) then
    print("hitting a player")
    end
    for a supply drop it would be:
    Code:
    if(hitinfo.HitEntity:GetComponentInParent(global.SupplyDrop._type)) then
    print("hitting a supply crate")
    end
    if GetComponentInParent doesn't work you might want to try also: GetComponent
     
  3. Thanks, I'll test this out in a minute.
    Is there a link to all this documentation? I couldn't find anything on the rust wiki or Oxide 2 wiki about any Lua documentation.
    [DOUBLEPOST=1419262998][/DOUBLEPOST]
    Your provided code works, thank you very much! :D
     
  4. Wulf is making a new design and will implement the documentation with the new design.
    but at the moment there is no documentation.
    only plugins that already exist :)

    i recommend you to look into:
    death messages
    finder
    r-zones
    r-remover

    i use a lot those kind of detections.