• EntitiyTakeDamage on Chair
    4 replies, posted
Chairs are not working with the EntityTakeDamage hook for me? They seem to work finder the player in the chair when I do this [lua] for k,v in pairs(ents.GetAll()) do if v:IsVehicle() then print(v:GetDriver()) end end [/lua] But when I do this it works with people in vehicles(prop_vehicle_jeep) but not anyone in a chair(prop_vehicle_prisoner_pod)? [lua] hook.Add("EntityTakeDamage", "DriverDamage", function( target, dmginfo ) if target:IsVehicle() && IsValid(target:GetDriver()) then print("You shot a guy in a vehicle") end end) [/lua] Any help would be appreciated!
Only a slight guess [CODE]if target:GetClass() == "prop_vehicle_*" && IsValid(target:GetDriver())[/CODE]
None of the chairs seem to call the EntityTakeDamage hook. Vehicles like Jeeps and such do though.
[QUOTE=Blasphemy;39774452]None of the chairs seem to call the EntityTakeDamage hook. Vehicles like Jeeps and such do though.[/QUOTE] All entities should call the EntityTakeDamage hook, except for worldspawn.
[QUOTE=Donkie;39774533]All entities should call the EntityTakeDamage hook, except for worldspawn.[/QUOTE] Then it's a bug, but I just tested and none of the pods called the hook when I shot them.
Sorry, you need to Log In to post a reply to this thread.