Let's say I initialize one Entity(index), how do I check if its still a valid index or if it even exists?
Syntax: Select all
from listeners.tick import Delay
ENTITY_TARGET = "flashbang_projectile"
@OnEntityCreated
def on_entity_created(index, ptr):
entity = Entity(index)
if not entity.classname == ENTITY_TARGET:
return
Delay(1.2, entity_kill, entity)
def entity_kill(entity)
# if not entity == INVALID_ENTITY?
entity.remove()