lia.utilities

Extension of lia.util that aims to help on several different actions.

Functions

SpeedTest(func, n)

Measures the average execution time of a function.

Parameters

  • func Function

    The function to test

  • n Integer

    The number of iterations

Returns

  • any

    number The average time in seconds it took to execute the function

spawnEntities(entityTable)

Spawns entities from a table of entity-position pairs.

Parameters

  • entityTable Table

    Table containing entity-position pairs

spawnProp(model, position, force, lifetime, angles, collision)

Spawns a prop at a given position with optional parameters.

Parameters

  • model String

    Model of the prop to spawn

  • position Vector

    Position to spawn the prop

  • force optional

    Force to apply to the prop

  • lifetime Integer optional

    Lifetime of the prop in seconds

  • angles Angle optional

    Angles of the prop

  • collision optional

    Collision group of the prop

Returns

  • any

    The spawned prop entity