Update Event.lua

#2143 Try with isExist
This commit is contained in:
Frank 2024-07-05 21:35:55 +02:00
parent 55a9c7e020
commit 29a4f7c160

View File

@ -1346,7 +1346,7 @@ function EVENT:onEvent( Event )
-- Weapon.
if Event.weapon then
Event.Weapon = Event.weapon
Event.WeaponName = Event.weapon.getTypeName and Event.weapon:getTypeName() or "Unknown Weapon"
Event.WeaponName = Event.weapon:isExist() and Event.weapon:getTypeName() or "Unknown Weapon"
Event.WeaponUNIT = CLIENT:Find( Event.Weapon, '', true ) -- Sometimes, the weapon is a player unit!
Event.WeaponPlayerName = Event.WeaponUNIT and Event.Weapon.getPlayerName and Event.Weapon:getPlayerName()
--Event.WeaponPlayerName = Event.WeaponUNIT and Event.Weapon:getPlayerName()