Appearance
sdk.localplayer
Local character: Player reads plus talk / walk / use / attack. Actions return ok, err.
lua
local M = require("sdk.localplayer")new
function · new(data: table): LocalPlayer
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
data | table | — |
Returns
| Type | Summary |
|---|---|
LocalPlayer | — |
inventory
method · inventory(self: LocalPlayer): Inventory
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Returns
| Type | Summary |
|---|---|
Inventory | — |
say
method · say(self: LocalPlayer, text: string): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
text | string | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
whisper
method · whisper(self: LocalPlayer, text: string): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
text | string | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
walk
method · walk(self: LocalPlayer, direction: Direction): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
direction | Direction | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
moveTo
method · moveTo(self: LocalPlayer, x: integer, y: integer, z: integer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
x | integer | — |
y | integer | — |
z | integer | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
stopWalk
method · stopWalk(self: LocalPlayer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
useItem
method · useItem(self: LocalPlayer, item_id: ItemId): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
item_id | ItemId | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
useItemAt
method · useItemAt(self: LocalPlayer, item_id: ItemId, location: ItemLocation): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
item_id | ItemId | — |
location | ItemLocation | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
useSkill
method · useSkill(self: LocalPlayer, words: string): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
words | string | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
skill
method · skill(self: LocalPlayer, name: string): SkillSnapshot?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
SkillSnapshot?, ErrorMessage? | — |
gold
method · gold(self: LocalPlayer): integer?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Returns
| Type | Summary |
|---|---|
integer?, ErrorMessage? | — |
attack
method · attack(self: LocalPlayer, target: Player|integer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
target | Player|integer | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
setTarget
method · setTarget(self: LocalPlayer, target: Player|integer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
target | Player|integer | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
changeTarget
method · changeTarget(self: LocalPlayer, target: Player|integer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
target | Player|integer | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
stopAttack
method · stopAttack(self: LocalPlayer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
follow
method · follow(self: LocalPlayer, target: Player|integer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
target | Player|integer | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
loot
method · loot(self: LocalPlayer, opts?: table): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
opts | table | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
setTactics
method · setTactics(self: LocalPlayer, options: PlayerTactics): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
options | PlayerTactics | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
turn
method · turn(self: LocalPlayer, direction: Direction): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
direction | Direction | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
logout
method · logout(self: LocalPlayer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
pickup
method · pickup(self: LocalPlayer, item: ItemStack|ItemId, count?: integer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
item | ItemStack|ItemId | — |
count | integer | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
equip
method · equip(self: LocalPlayer, item: ItemStack|ItemId): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
item | ItemStack|ItemId | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
dequip
method · dequip(self: LocalPlayer, slot: integer): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
slot | integer | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
closeContainer
method · closeContainer(self: LocalPlayer, container: ContainerId): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
container | ContainerId | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
useWith
method · useWith(self: LocalPlayer, from: any, to: any): Result?, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
from | any | — |
to | any | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
canCast
method · canCast(self: LocalPlayer, words: string): boolean|nil, ErrorMessage?
Local player actions return true when accepted by the local client, or nil, error before/while sending. Acceptance is not server acknowledgement.
Parameters
| Name | Type | Summary |
|---|---|---|
words | string | — |
Returns
| Type | Summary |
|---|---|
boolean|nil, ErrorMessage? | — |