HolyLib Wiki

unholylib.SetEntIndex

  unholylib.SetEntIndex( Entity ent, number index )

Description

Sets the EntIndex of the given entity, internally it will attempt to move the entity into the given edict slot.
If the edict slot is already used, it will swap the entities.
If the new index is -1 then it will make the entity a server-only entity.

Recently Added

This was recently added in version (0.8 - DEV).

Arguments

1Entity ent

the Entity to change

2number index

index to set/switch with or -1 to make it a server-only entity