Scripting
Script Structure
onUse(player, item, fromPosition, target, toPosition, isHotkey)Parameters:
player: Player who is using the item.
item: Item which is being clicked on by the player.
fromPosition: Position of where the item is clicked from.
target: The item/creature the item is used on (use with, like a fishing rod). If the item does not have the
use with
flag,target
is equal toitem
.toPosition: Position of where the target is located.
isHotkey: True if the item was used from hotkeys, otherwise false.
Return Value:
true: Will allow the usage of the item, no message will be sent.
false: Will not use the item, player will be sent a cancel message containing the words "You cannot use this object."
Example
Last updated