ITEM.Accessory
The accessory item base. Contains helpers for equipping, removing and expiring accessories.
- SharedITEM:canDestroy(ply, amt) → boolean, string?Source ☍
-
canDestroyhook/override for this item base. Refuses destroying the last copy of an accessory the player is still wearing.Parameters
- plyPlayer
- amtnumber
Returns
- 1boolean
- 2string?
- SharedITEM:canDrop(ply, pos, amt) → boolean, string?Source ☍
-
canDrophook/override for this item base.Parameters
Returns
- 1boolean
- 2string?
- SharedITEM:canGive(ply, amt, to) → boolean, string?Source ☍
-
canGivehook/override for this item base.Parameters
Returns
- 1boolean
- 2string?
- SharedITEM:canLoseWornCopies(ply, amt) → boolean, string?Source ☍
-
Whether the player can lose
amtcopies without wearing an accessory they no longer hold.Parameters
- plyPlayer
- amtnumberCopies leaving the inventory.
Returns
- 1boolean
- 2string?
- SharedITEM:generateTimer(time, ply, func, name)Source ☍
-
Generate a unique timer for an action, player and item set. Removes and resets the existing timer if it exists.
Parameters
- timenumberHow long to run this timer for.
- plyPlayerPlayer we're running this timer for.
- funcfunctionCallback function when timer expires.
- namestring?Timer name.
- SharedITEM:generateTimerName(ply, name) → stringSource ☍
-
Generate a timer name, unique for an action, player and item.
Parameters
- plyPlayerPlayer to generate the timer for.
- namestring?Name of the timer.
Returns
- stringName
- SharedITEM:onDestroy(ply)Source ☍
-
onDestroyhook/override for this item base.Parameters
- plyPlayer
- SharedITEM:onDrop(ply, pos)Source ☍
-
onDrophook/override for this item base.Parameters
- SharedITEM:onGive(ply, pos)Source ☍
-
onGivehook/override for this item base.Parameters
- SharedITEM:onRemove(ply) → booleanSource ☍
-
onRemovehook/override for this item base.Parameters
- plyPlayer
Returns
- boolean
- SharedITEM:onUse(ply) → booleanSource ☍
-
onUsehook/override for this item base.Parameters
- plyPlayer
Returns
- boolean
- SharedITEM.SetExpireEmoteSource ☍
-
Set the Emote used when when this accessory expires.
- SharedITEM.SetExpiresSource ☍
-
Set the time that this accessory takes to expire.
- SharedITEM.SetOffEmoteSource ☍
-
Set the Emote used when when this accessory is removed.
- SharedITEM.SetOnEmoteSource ☍
-
Set the Emote used when when this accessory is used.
- SharedITEM.SetPostExpireSource ☍
-
Set the function called after this item expires.
- SharedITEM.SetPostRemoveSource ☍
-
Set the function called after this item is removed.
- SharedITEM.SetPostUseSource ☍
-
Set the function called after this item is used.
- SharedITEM.SetSingleUseSource ☍
-
Sets if this item is single use.