Jump to content

Recommended Posts

Hi,

So I know that invalid entities are entities in the process of removal... but exactly what entities are invalid, for which you have to use the :IsValid() to check for? And do these entities remain in the Ents table, or have they already been removed?

 

Thanks!

Edited by Bad Willow
10 hours ago, Bad Willow said:

So I know that invalid entities are entities in the process of removal...

Invalid entities are any entities that have been removed.

10 hours ago, Bad Willow said:

but exactly what entities are invalid

Any entity can be invalid.

10 hours ago, Bad Willow said:

And do these entities remain in the Ents table

They are removed from the Ents table, provided they are removed normally.

  • Like 1

Ahh okay. So if a mob is added to a table and the mob is killed, the table would still contain the reference even though the entity has been supposedly removed... I hope I got it right. I do have  an additional question... does killing a mob immediately trigger its removal?

2 hours ago, Bad Willow said:

So if a mob is added to a table and the mob is killed, the table would still contain the reference even though the entity has been supposedly removed... I hope I got it right.

It is removed from the table once it is done removing (removing listeners, detatching from parents, etc). Look at EntityScript:Remove and follow it from there.

2 hours ago, Bad Willow said:

does killing a mob immediately trigger its removal?

Generally no, It usually takes about two seconds, but some mobs configure this. Look at Health:SetVal.

 

Edited by penguin0616
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...