TLDR: How do I reference object out of scope. how do I despawn/destroy npc
I am trying to spawn a hostile npc with CharacterCreateAtPosition() and that works fine however I cant figure out how to destroy/despawn the creature later on.
IF
something()
AND
CharacterCreateAtPosition(_x,_y,_z,"Harth_Field_Skeleton_weak_04588216-1307-4569-ae7d-1a34aa43f4c8",1,_Skeleton1)
THEN
something()
After this block I need another check that destroys the _Skeleton1 under certain conditions but the _Skeleton1 can't be referenced in other blocks because it is out of scope. I also don't know what functions to use to destroy or despawn a character. DB_CharacterDestroy is listed on the larian docs but doesn't show as a usable function when i tried testing on another npc.