Player Lua API

From Off Grid Wiki
Revision as of 17:17, 22 June 2017 by Rich (talk | contribs) (Rich moved page Player Lua API to Lua Apis/Player Lua API without leaving a redirect: adding sub-pages)
Jump to navigation Jump to search

Player

Description

The Player API handles querying and setting the state of the player

Functions

AddItemToInventory

Player.AddItemToInventory(itemTable)

Expected parameter types

itemTable Lua Type

Description: Adds an item to the players inventory

Returns: Nothing

RemoveItemFromInventory

Player.RemoveItemFromInventory(itemTable)

Expected parameter types

itemTable Lua Type

Description: Removes an item to the players inventory

Returns: Nothing

HasItem

Player.HasItem(itemName)

Expected parameter types

itemName string

Description: Is an item in the players inventory

Returns: true if the item is in the players inventory, else false

ClearInventory

Player.ClearInventory()

Description: Removes all items from the players inventory

Returns: Nothing

SetPlayerNFCData

Player.SetPlayerNFCData(dataTable)

Expected parameter types

dataTable Lua Type

Description: Sets the NFC data on the players phone

Returns: Nothing

AddDataFile

Player.AddDataFile(dataTable)

Expected parameter types

dataTable Lua Type

Description: Adds a data file directly to the players data inventory without a sender

Returns: Nothing

ClearDataInventory

Player.ClearDataInventory()

Description: Removes all data files from the players data inventory

Returns: Nothing

ItemInQuickSlot

Player.ItemInQuickSlot()

Description: Gets the name of the item currently in the players quick slot

Returns: string

HasDataFile

Player.HasDataFile(dataFileName)

Expected parameter types

dataFileName string

Description: Does the player have a data file with this name?

Returns: bool

HasEncryptedFile

Player.HasEncryptedFile(dataFileName)

Expected parameter types

dataFileName string

Description: Does the player have a file with the name _dataFileName_ and is it encrypted?

Returns: bool

HasDecryptedFile

Player.HasDecryptedFile(dataFileName)

Expected parameter types

dataFileName string

Description: Does the player have a file with the name _dataFileName_ and is it unencrypted?

Returns: bool

GetName

Player.GetName()

Description: Get the Player's internalName

Returns: string

SetAlwaysRagdoll

Player.SetAlwaysRagdoll(state)

Expected parameter types

state bool

Description: Player character aways ragdolls on death

Returns: Nothing

SetInvisible

Player.SetInvisible(state)

Expected parameter types

state bool

Description: Player character is invisible

Returns: Nothing


Docs last hacked together on: 09/05/2017 12:46