Class ITEM.base_suit
Spawnable Suit Item.
The suit base is a clothing, with extra helpers for handling suits / dresses and auto
Class Overview
Hooks
| ITEM.base_suit.canUse(ply) | Checks if a item can be used. |
| ITEM.base_suit.canGive(ply, to, amt) | Checks if a item can be given. |
| ITEM.base_suit.canRemove(ply) | Checks if a item can be removed. |
| ITEM.base_suit.canDrop(ply, pos, amt) | Checks if a item can be dropped. |
| ITEM.base_suit.canDestroy(ply, amt) | Checks if a item can be destroyed. |
| ITEM.base_suit.canPickup(ply) | Checks if a item can be picked up. |
| ITEM.base_suit.canSell(ply, amt) | Checks if a item can be sold up. |
| ITEM.base_suit.canPlace(ply, pos, amt) | Checks if a item can be placed. |
Fields
| ITEM.base_suit.name | Item Name. |
| ITEM.base_suit.description | Description of the item. |
| ITEM.base_suit.size | Item Size |
| ITEM.base_suit.cost | Item Cost |
| ITEM.base_suit.model | Model Path |
| ITEM.base_suit.store | Market Availability |
| ITEM.base_suit.category | Inventory / Market Category |
| ITEM.base_suit.skin | Skin used in the F1 menu. |
| ITEM.base_suit.__index | The lookup index for the item metatable. |
Methods
| ITEM.base_suit:SetTie(data) | Sets the tie bodygroup this model should have. |
| ITEM.base_suit:SetNonMember(data) | Sets the clothing to not be membership. |
| ITEM.base_suit:SetEmotes(on, off) | Set on/off emotes. |
| ITEM.base_suit:New(base, data) | Create a new item. |
| ITEM.base_suit:Clone() | Clone an item. |
| ITEM.base_suit:Merge(data) | Merge a table of data into the item. |
| ITEM.base_suit:SetData(name, value) | Set a single key on the item. |
| ITEM.base_suit:Register([id]) | Register an item. |
| ITEM.base_suit:AutoFunction(name, key) | Creates an automatically named setter function. |
| ITEM.base_suit:SetCost(cost) | Sets the Market Cost. |
| ITEM.base_suit:SetPrice(data) | Alias of ITEM:SetCost |
| ITEM.base_suit:SetDescription(data) | Sets the Description of an item. |
| ITEM.base_suit:SetDesc(data) | Alias of ITEM:SetDescription |
| ITEM.base_suit:SetCategory(data) | Sets the category of an item. |
| ITEM.base_suit:SetCat(data) | Alias of ITEM:SetCategory |
| ITEM.base_suit:SetTeam(data) | Sets the team of an item. |
| ITEM.base_suit:SetBatch(data) | Sets the number of items created in a press of the manufacture button. |
| ITEM.base_suit:SetMember(data) | Sets the required membership level to use this item. |
| ITEM.base_suit:SetREPs(data) | Sets the required REP count to use this item. |
| ITEM.base_suit:SetREP(data) | Alias of ITEM:SetREPs |
| ITEM.base_suit:SetCanUse(data) | Sets the canUse function on this item. |
| ITEM.base_suit:SetSize(data) | Sets the inventory size of this item. |
| ITEM.base_suit:SetName(name[, Plural= |
Sets the name of an item. |
| ITEM.base_suit:SetModel(model, skin[, Should]) | Sets the model of the item. |
| ITEM.base_suit:SetStoreModel(model, skin) | Sets the store model of the item. |
| ITEM.base_suit:SetStoreSkin(skin[, autoStore]) | Sets the store skin of the item. |
| ITEM.base_suit:SetPlural([name]) | Sets the item's plural. |
| ITEM.base_suit:SetStore(val) | Set if the item is in store, and its batch amount. |
| ITEM.base_suit:Replaced([by]) | Sets if a item is replaced. |
| ITEM.base_suit:Replacement(new, old) | Create a simple replacement item. |
| ITEM.base_suit:CanUse(func) | Sets the canUse function for this item. |
| ITEM.base_suit:OnUse(func) | Sets the onUse function for this item. |
| ITEM.base_suit:CanGive(func) | Sets the canGive function for this item. |
| ITEM.base_suit:OnGive(func) | Sets the onGive function for this item. |
| ITEM.base_suit:CanRemove(func) | Sets the canRemove function for this item. |
| ITEM.base_suit:OnRemove(func) | Sets the onRemove function for this item. |
| ITEM.base_suit:CanDrop(func) | Sets the canDrop function for this item. |
| ITEM.base_suit:OnDrop(func) | Sets the onDrop function for this item. |
| ITEM.base_suit:CanDestroy(func) | Sets the canDestroy function for this item. |
| ITEM.base_suit:OnDestroy(func) | Sets the onDestroy function for this item. |
| ITEM.base_suit:CanPickup(func) | Sets the canPickup function for this item. |
| ITEM.base_suit:OnPickup(func) | Sets the onPickup function for this item. |
| ITEM.base_suit:CanSell(func) | Sets the canSell function for this item. |
| ITEM.base_suit:OnSell(func) | Sets the onSell function for this item. |
| ITEM.base_suit:CanPlace(func) | Sets the canPlace function for this item. |
| ITEM.base_suit:onPlace(func) | Sets the onPlace function for this item. |
- ITEM.base_suit.canUse(ply)
-
Checks if a item can be used.
Parameters:
- ply Player Player using the item.
Inhereted from:
- ITEM.base_suit.canGive(ply, to, amt)
-
Checks if a item can be given.
Parameters:
- ply Player Player giving the item.
- to Player Player receiving the item.
- amt int Number of items being given.
Inhereted from:
- ITEM.base_suit.canRemove(ply)
-
Checks if a item can be removed.
Parameters:
- ply Player Player removing the item.
Inhereted from:
- ITEM.base_suit.canDrop(ply, pos, amt)
-
Checks if a item can be dropped.
Parameters:
- ply Player Player dropping the item.
- pos Vector Drop location.
- amt int Number of items being dropped.
Inhereted from:
- ITEM.base_suit.canDestroy(ply, amt)
-
Checks if a item can be destroyed.
Parameters:
- ply Player Player destroying the item.
- amt int Number of items being destroyed.
Inhereted from:
- ITEM.base_suit.canPickup(ply)
-
Checks if a item can be picked up.
Parameters:
- ply Player Player picking the items up.
Inhereted from:
- ITEM.base_suit.canSell(ply, amt)
-
Checks if a item can be sold up.
Parameters:
- ply Player Player selling items.
- amt int Number of items being sold.
Inhereted from:
- ITEM.base_suit.canPlace(ply, pos, amt)
-
Checks if a item can be placed.
Parameters:
- ply Player Player placing items.
- pos Vector Place location.
- amt int Number of items being placed.
Inhereted from:
- ITEM.base_suit.name
-
Item Name.
- name string The localised name, as shown in the F1 menu.
Inhereted from:
- ITEM.base_suit.description
-
Description of the item.
- description string
Inhereted from:
- ITEM.base_suit.size
-
Item Size
- size number The inventory space used per item.
Inhereted from:
- ITEM.base_suit.cost
-
Item Cost
- cost int The cost of the item as bought in the market. Also used for inventory valuations and refund sales.
Inhereted from:
- ITEM.base_suit.model
-
Model Path
- model string Path of the model used in the F1 menu / dropped states.
Inhereted from:
- ITEM.base_suit.store
-
Market Availability
- store bool
Inhereted from:
- ITEM.base_suit.category
-
Inventory / Market Category
- category string
Inhereted from:
- ITEM.base_suit.skin
-
Skin used in the F1 menu.
- skin int
Inhereted from:
- ITEM.base_suit.__index
-
The lookup index for the item metatable.
- __index table
Inhereted from:
- ITEM.base_suit:SetTie(data)
-
Sets the tie bodygroup this model should have.
Parameters:
- data int or false BG Index of the tie or false to disable.
- ITEM.base_suit:SetNonMember(data)
-
Sets the clothing to not be membership.
Parameters:
- data bool NonMember flag setting.
Returns:
Inhereted from:
- ITEM.base_suit:SetEmotes(on, off)
-
Set on/off emotes.
Parameters:
Returns:
Inhereted from:
- ITEM.base_suit:New(base, data)
-
Create a new item.
Parameters:
- base string UniqueID of the baseclass.
- data tab Optional data to fill into the item.
Returns:
Inhereted from:
- ITEM.base_suit:Clone()
-
Clone an item.
Returns a new ITEM, with base set to the first item.
Returns:
Inhereted from:
- ITEM.base_suit:Merge(data)
-
Merge a table of data into the item.
Parameters:
- data tab Key/Value pairs of data.
Returns:
Inhereted from:
- ITEM.base_suit:SetData(name, value)
-
Set a single key on the item.
Parameters:
- name string Key to set.
- value Value to set.
Returns:
Inhereted from:
- ITEM.base_suit:Register([id])
-
Register an item.
This must be the last call in an item chain, as it does processing on the item.
Parameters:
- id string UniqueID to set, not required if set prior. (optional)
Inhereted from:
- ITEM.base_suit:AutoFunction(name, key)
-
Creates an automatically named setter function.
It also returns a single param function, which sets a default value and returns the item.
Parameters:
Returns:
-
function
Inhereted from:
See also:
Usage:
local setDefault = ITEM:AutoFunction("SpecialValue", "internal_flag") -- This creates a function, ITEM:SetSpecialValue(). -- Calling this function sets a value on ITEM.internal_flag. -- Calling setDefault, sets the value now, returning the item. This is useful for chaining. ITEM:AutoFunction("SomeValue", "this_defaults_to_false")(false)
- ITEM.base_suit:SetCost(cost)
-
Sets the Market Cost.
Parameters:
- cost int Cost.
Returns:
Inhereted from:
- ITEM.base_suit:SetPrice(data)
-
Alias of ITEM:SetCost
Parameters:
- data int Cost.
Returns:
Inhereted from:
See also:
- ITEM.base_suit:SetDescription(data)
-
Sets the Description of an item.
Parameters:
- data string New Description
Returns:
Inhereted from:
- ITEM.base_suit:SetDesc(data)
-
Alias of ITEM:SetDescription
Parameters:
- data string New Description
Returns:
Inhereted from:
See also:
- ITEM.base_suit:SetCategory(data)
-
Sets the category of an item.
Parameters:
- data string New category
Returns:
Inhereted from:
- ITEM.base_suit:SetCat(data)
-
Alias of ITEM:SetCategory
Parameters:
- data string New category
Returns:
Inhereted from:
See also:
- ITEM.base_suit:SetTeam(data)
-
Sets the team of an item.
Parameters:
- data int Team Index
Returns:
Inhereted from:
- ITEM.base_suit:SetBatch(data)
-
Sets the number of items created in a press of the manufacture button.
Parameters:
- data int Batch
Returns:
Inhereted from:
- ITEM.base_suit:SetMember(data)
-
Sets the required membership level to use this item.
Parameters:
- data int Membership Level
Returns:
Inhereted from:
- ITEM.base_suit:SetREPs(data)
-
Sets the required REP count to use this item.
Parameters:
- data int REP Count
Returns:
Inhereted from:
- ITEM.base_suit:SetREP(data)
-
Alias of ITEM:SetREPs
Parameters:
- data string REP Count
Returns:
Inhereted from:
See also:
- ITEM.base_suit:SetCanUse(data)
-
Sets the canUse function on this item.
Parameters:
- data func canUse function.
Returns:
Inhereted from:
- ITEM.base_suit:SetSize(data)
-
Sets the inventory size of this item.
Parameters:
- data int Size
Returns:
Inhereted from:
-
ITEM.base_suit:SetName(name[, Plural=
s]) -
Sets the name of an item.
If plural is undefined, defaults to "
s" If plural is true, it's set to " " Parameters:
Inhereted from:
- ITEM.base_suit:SetModel(model, skin[, Should])
-
Sets the model of the item.
If model is true, the model and skin will be pulled from the store model.
If autostore is true, model and skin will be pushed to the store model.
Parameters:
- model string or true Model path.
- skin int Skin index.
- Should bool this also automatically set the store models. (optional)
Returns:
Inhereted from:
- ITEM.base_suit:SetStoreModel(model, skin)
-
Sets the store model of the item.
If model is true, the model and skin will be pulled from the regular model.
Parameters:
- model string or true Model path.
- skin int Skin index.
Returns:
Inhereted from:
- ITEM.base_suit:SetStoreSkin(skin[, autoStore])
-
Sets the store skin of the item.
If skin is true, it is pulled from the item skin.
Parameters:
- skin int or true skin
- autoStore bool If skin should be pushed to item skin. (optional)
Inhereted from:
- ITEM.base_suit:SetPlural([name])
-
Sets the item's plural.
If nil/false, item's name + s is used.
If true, item's name is used.
Otherwise passed name is used.
Parameters:
- name string or true (optional)
Returns:
Inhereted from:
- ITEM.base_suit:SetStore(val)
-
Set if the item is in store, and its batch amount.
If boolean, store is directly set.
If 0, store is set to false.
Otherwise store is set true and the value
Parameters:
- val bool or int Store Setting / Batch Amount
Returns:
Inhereted from:
- ITEM.base_suit:Replaced([by])
-
Sets if a item is replaced.
If called with no args, replaced flag is cleared.
Parameters:
- by string Unique ID of replaced item. (optional)
Returns:
Inhereted from:
- ITEM.base_suit:Replacement(new, old)
-
Create a simple replacement item.
new's item must be registered before the replacement call.
Parameters:
Inhereted from:
- ITEM.base_suit:CanUse(func)
-
Sets the canUse function for this item.
Parameters:
- func func [opt=function() return true end] Function to set as the canUse function.
Returns:
Inhereted from:
- ITEM.base_suit:OnUse(func)
-
Sets the onUse function for this item.
Parameters:
- func func Function to set as the onUse function.
Returns:
Inhereted from:
- ITEM.base_suit:CanGive(func)
-
Sets the canGive function for this item.
Parameters:
- func func [opt=function() return true end] Function to set as the canGive function.
Returns:
Inhereted from:
- ITEM.base_suit:OnGive(func)
-
Sets the onGive function for this item.
Parameters:
- func func Function to set as the onGive function.
Returns:
Inhereted from:
- ITEM.base_suit:CanRemove(func)
-
Sets the canRemove function for this item.
Parameters:
- func func [opt=function() return true end] Function to set as the canRemove function.
Returns:
Inhereted from:
- ITEM.base_suit:OnRemove(func)
-
Sets the onRemove function for this item.
Parameters:
- func func Function to set as the onRemove function.
Returns:
Inhereted from:
- ITEM.base_suit:CanDrop(func)
-
Sets the canDrop function for this item.
Parameters:
- func func [opt=function() return true end] Function to set as the canDrop function.
Returns:
Inhereted from:
- ITEM.base_suit:OnDrop(func)
-
Sets the onDrop function for this item.
Parameters:
- func func Function to set as the onDrop function.
Returns:
Inhereted from:
- ITEM.base_suit:CanDestroy(func)
-
Sets the canDestroy function for this item.
Parameters:
- func func [opt=function() return true end] Function to set as the canDestroy function.
Returns:
Inhereted from:
- ITEM.base_suit:OnDestroy(func)
-
Sets the onDestroy function for this item.
Parameters:
- func func Function to set as the onDestroy function.
Returns:
Inhereted from:
- ITEM.base_suit:CanPickup(func)
-
Sets the canPickup function for this item.
Parameters:
- func func [opt=function() return true end] Function to set as the canPickup function.
Returns:
Inhereted from:
- ITEM.base_suit:OnPickup(func)
-
Sets the onPickup function for this item.
Parameters:
- func func Function to set as the onPickup function.
Returns:
Inhereted from:
- ITEM.base_suit:CanSell(func)
-
Sets the canSell function for this item.
Parameters:
- func func [opt=function() return true end] Function to set as the canSell function.
Returns:
Inhereted from:
- ITEM.base_suit:OnSell(func)
-
Sets the onSell function for this item.
Parameters:
- func func Function to set as the onSell function.
Returns:
Inhereted from:
- ITEM.base_suit:CanPlace(func)
-
Sets the canPlace function for this item.
Parameters:
- func func [opt=function() return true end] Function to set as the canPlace function.
Returns:
Inhereted from:
- ITEM.base_suit:onPlace(func)
-
Sets the onPlace function for this item.
Parameters:
- func func Function to set as the onPlace function.
Returns:
Inhereted from: