Private
_slotThe slotId of the tool. [Used internally].
If set to false, players will not be able to equip or de-equip the tool.
The assetId of the tool's model.
Readonly
nameThe name of the tool. *
Static
Readonly
captureStatic
captureSets or gets the default captureRejection value for all emitters.
Static
defaultStatic
Readonly
errorThis symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
Static
toolStatic
Readonly
activatedFires when a player holding the tool clicks the left mouse button.
This will not be emitted if you disable the toolHandler.js core script.
let tool = new Tool("Balloon")
tool.model = 84038
Game.on("playerJoin", (player) => {
player.on("initialSpawn", () => {
player.equipTool(tool)
})
})
tool.on("activated", (p) => {
console.log(p.username + " has clicked with the tool equipped!")
})
Static
Readonly
equippedFires when a player equips a tool.
Static
Readonly
unequippedFires when a player unequips a tool.
Calls the specified callback with the player who equipped the tool.
let tool = new Tool("Balloon")
tool.model = 84038
tool.equipped((p) => {
p.setJumpPower(20) // Give the player a height boost
})
Calls the specified callback with the player who un-equipped the tool.
let tool = new Tool("Balloon")
tool.model = 84038
tool.unequipped((p) => {
p.setJumpPower(5) // Reset their jump power back to normal.
})
Static
listenerStatic
onStatic
once
This is used for creating tools that can be used by in-game players.