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
Get hitinfo.HitEntity name?
Discussion in 'Rust Development' started by BedIntruder319, Dec 22, 2014.
-
Code:
hitinfo.HitEntity.gameObject.name
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
Code:if(hitinfo.HitEntity:GetComponentInParent(global.SupplyDrop._type)) then print("hitting a supply crate") end
-
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] -
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.