SlashCo Wiki

SlashCo.CreateItem

 Entity SlashCo.CreateItem( string class, Vector pos, Angle ang, Entity owner )

Description

Spawns an item or other entity at the specified position and angle.
If an owner is supplied and is valid, the created entity is assigned to that owner.
Returns nil if the entity could not be created.

Arguments

1string class

The entity class to create.

2Vector pos

The position where the entity should be spawned.

3Angle ang

The angles the entity should be spawned with.

4Entity owner

The entity that should become the owner of the created entity.

Returns

1Entity ent

The created entity, or nil if creation failed.