Skip to content

Client

Provides client functionality for item behaviour.

Returns the item instance in the viewmodel. Allows you to make changes to the viewmodel item model. May return nil in various circumstances.

MapObject?

Decreases the ammo of the item by 1, updating UI.

NameTypeDefaultDescription
itemItemThe item.

Sets the last use timestamp for the item.

NameTypeDefaultDescription
itemItemThe item.
action"Primary" | "Alternate"The action.

Does the muzzle flash for an item, if applicable.

NameTypeDefaultDescription
itemItemThe item.

Recoils from an item.

NameTypeDefaultDescription
itemItemThe item.

Plays the empty clip sound.

NameTypeDefaultDescription
itemItemThe item.

Performs the primary fire action on the client, setting server data. This function does not itself replicate the fire to the server.

NameTypeDefaultDescription
itemItemThe item.
originVector3The origin.
directionVector3The direction, not accounting for spread.
noEffectsboolean?If true, the item state will not change, and visual effects will not be played. The item’s server data will still be set (regardless of noEffects, this is not yet replicated).

string | {string} | boolean

If returning a string, or table of strings, the primary fire was rejected with the provided reason(s). If returning a boolean, true indicates that the primary fire was successful, false indicates it was rejected with no further reason.

Aims the item if possible.

NameTypeDefaultDescription
itemItemThe item.

boolean

Always returns true.

Attempts to reload the weapon. Returns true if successful, false if not.

NameTypeDefaultDescription
itemItemThe item.

boolean

Tells the server that an action was performed.

NameTypeDefaultDescription
action"Primary" | "Alternate"The action.
itemItemThe item.
originVector3The origin.
directionVector3The direction, adjusted for spread