Armor
Index
Interfaces
Functions
Interfaces
ArmorGeneralFunction
Parameters
item: ItemInstance
slot: number
player: number
Returns void
ArmorHurtFunction
Parameters
item: ItemInstance
slot: number
player: number
value: number
type: number
attacker: number
bool1: boolean
bool2: boolean
Returns void
IArmorCallback
hurt
Parameters
params: IArmorHurtParams
slot: ItemInstance
index: number
armorInfo: IArmorInfo
Returns boolean
tick
Parameters
slot: ItemInstance
index: number
armorInfo: IArmorInfo
Returns boolean
IArmorHurtParams
attacker
Attacker entity or -1 if the damage was not caused by an entity.
bool1
TODO: Unknown param!
bool2
TODO: Unknown param!
damage
Damage amount that was applied to the player.
type
Damage type.
IArmorInfo
callback
durability
IArmorJSCallback
hurt
Called when player deals damage if player wears the armor.
Parameters
params: IArmorHurtParams
additional data about damage
slot: ItemInstance
current armor item instance
index: number
armor slot, one of the EArmorType values
durability: number
maximum damage the armor
Returns boolean
true
, if changes to the item parameter should be applied,false
otherwise.
tick
Called every tick if player wears the armor.
Parameters
slot: ItemInstance
current armor item instance
index: number
armor slot, one of the EArmorType values
durability: number
maximum damage the armor
Returns boolean
true
, if changes to the item parameter should be applied,false
otherwise.
Functions
preventDamaging
Prevents armor from being damaged.
Parameters
id: string | number
armor item string or numeric ID
Returns void
registerFuncs
Registers armor's hurt and tick functions.
Parameters
id: string | number
armor item string or numeric ID
funcs: IArmorJSCallback
Returns void
registerLocalOnTakeOffListener
This event is called when local player takes off or changes this armor item.
Parameters
id: number
func: ArmorGeneralFunction
Returns void
registerLocalOnTakeOnListener
This event is called when local player takes on this armor, or spawns with it.
Parameters
id: number
func: ArmorGeneralFunction
Returns void
registerOnHurtListener
This event is called when the damage is dealt to the player that has this armor put on.
Parameters
id: number
func: ArmorHurtFunction
Returns void
Item object to change armor item, if nothing is returned, armor will not be changed.
registerOnLocalTickListener
This event is called every tick for local player that has this armor put on.
Parameters
id: number
func: ArmorGeneralFunction
Returns void
Item object to change armor item, if nothing is returned, armor will not be changed.
registerOnTakeOffListener
This event is called when player takes off or changes this armor item.
Parameters
id: number
func: ArmorGeneralFunction
Returns void
registerOnTakeOnListener
This event is called when player takes on this armor, or spawns with it.
Parameters
id: number
func: ArmorGeneralFunction
Returns void
registerOnTickListener
This event is called every tick for every player that has this armor put on.
Parameters
id: number
func: ArmorGeneralFunction
Returns void
Item object to change armor item, if nothing is returned, armor will not be changed.
Module used to manage armor's behavior.