Here (I found that one problem was that I forgot the second line):
If CountCollisions(soldier2)>0
entity=EntityCollided(soldier2,1)
any_weapon.weapon=Object.weapon(EntityName(entity))
HideEntity any_weapon\inactive_model
On the fourth line, I get the classic "Entity does not exist error". This dissappears when I add:
If entity=True
after the second line, but then no commands are executed after that. While the program functions normally after that, I'm back to where I started.:(
P.S., all this code is in functions, and creating and using the weapons are in two different functions, but all the variables, including the types are global.
By the way how do you insert those code pieces?
If CountCollisions(soldier2)>0
entity=EntityCollided(soldier2,1)
any_weapon.weapon=Object.weapon(EntityName(entity))
HideEntity any_weapon\inactive_model
On the fourth line, I get the classic "Entity does not exist error". This dissappears when I add:
If entity=True
after the second line, but then no commands are executed after that. While the program functions normally after that, I'm back to where I started.:(
P.S., all this code is in functions, and creating and using the weapons are in two different functions, but all the variables, including the types are global.
By the way how do you insert those code pieces?