Skip to content

Player

addBankBalance

Adds to the player's bank balance.

lua
player:addBankBalance(amount)

addBlessing

Adds a blessing to a player.

lua
player:addBlessing(blessing_id)

addCoins

Adds coins to the player.

lua
player:addCoins(amount, sendPacket)

addFriend

Adds a new friend. Also updates the friend's list.

lua
player:addFriend(targetPlayer)

addGems

Adds a specified amount of gems to the player.

lua
player:addGems(amount, sendPacket, isDisplay)

addGrowpassPoints

Adds Growpass points to a player.

lua
player:addGrowpassPoints(points)

addLevel

Adds a specified number of levels to the player.

lua
player:addLevel(amount)

addMail

Adds a new mail to the player's mailbox.

lua
player:addMail(mailDataTable)

addMod

Adds a temporary modification (e.g., curse, buff) to the player.

lua
player:addMod(modID, durationSeconds)

addTitle

Adds a title to the player.

lua
player:addTitle(id)

adjustBlockHitCount

Adjusts the number of hits required to break blocks for this player. 1 makes it harder, -1 makes it easier (max +10/-10).

lua
player:adjustBlockHitCount(amount)

ban

Bans the player. length_seconds = 0 for a permanent ban. banned_by_player is another player object (can be nil). ban_device and ban_ip are 0 (no) or 1 (yes).

lua
player:ban(length_seconds, reason, banned_by_player, ban_device, ban_ip)

changeItem

Adds (amount > 0) or removes (amount < 0) an item from the player's inventory.

lua
player:changeItem(itemID, amount, isSendPacket)

checkPassword

Checks if the provided password string matches the player's account password. Returns true if it matches.

lua
player:checkPassword(passwordString)

clearMailbox

Clears all mail from the player's mailbox.

lua
clearMailbox()

disconnect

Disconnects the player from the server.

lua
disconnect()

doAction

Sends a packet on behalf of the player. Example: player:doAction("action|input\n|text|hello").

lua
player:doAction(actionString)

enterWorld

Teleports the player to a specified world.

lua
player:enterWorld(worldName, doorID)

getAccessWorlds

Returns a list of World IDs where the player has build access.

lua
getAccessWorlds()

getAccountCreationDateStr

Returns the Account Creation Date.

lua
getAccountCreationDateStr()

getAchievementsCount

Returns the total number of available achievements.

lua
getAchievementsCount()

getAdjustedBlockHitCount

Returns the current adjusted block hit count value.

lua
getAdjustedBlockHitCount()

getAltAccounts

Returns an array of alternative accounts linked to this player.

lua
getAltAccounts()

getBackpackItems

Returns a table of all items in the player's backpack.

lua
getBackpackItems()

getBackpackUsedSize

Returns the number of used slots in the backpack.

lua
getBackpackUsedSize()

getBankBalance

Returns the player's bank balance.

lua
getBankBalance()

getBiweeklyQuests

Returns a table with the player's Biweekly Quest tasks.

lua
getBiweeklyQuests()

getClassicProfileContent

Returns the ClassicProfile Content.

lua
player:getClassicProfileContent(cat, flags)

getCleanName

Returns the player's name without any special formatting.

lua
getCleanName()

getClothingItemID

Gets the item ID of clothing in a specific slot (e.g., PlayerClothes.HAND).

lua
player:getClothingItemID(slot)

getCoins

Returns the player's coin count.

lua
getCoins()

getCountry

Returns the player's country code (e.g., "us").

lua
getCountry()

getCountryFlagBackground

Returns the item ID of the player's country flag background.

lua
getCountryFlagBackground()

getCountryFlagForeground

Returns the item ID of the player's country flag foreground.

lua
getCountryFlagForeground()

getDiscordID

Returns the Player's Discord ID.

lua
getDiscordID()

getDiscordInvites

Returns the number of Discord invites a player has.

lua
getDiscordInvites()

getEmail

Returns the player's email address.

lua
getEmail()

getFriends

Returns a table with friend user IDs.

lua
getFriends()

getGems

Returns the player's gem count.

lua
getGems()

getGender

Returns the player's gender.

lua
getGender()

getGuildID

Returns the Guild ID.

lua
getGuildID()

getHomeWorldID

Returns Player's Home World ID.

lua
getHomeWorldID()

getInventoryItems

Returns a table of all items in the player's inventory. Iterate through it to access individual items.

lua
getInventoryItems()

getInventorySize

Returns the player's inventory size.

lua
getInventorySize()

getIP

Returns the player's IP address as a string.

lua
getIP()

getIPHistory

Returns a list of IP addresses recently used by the account.

lua
getIPHistory()

getItemAmount

Returns the amount of a specific item the player has in their inventory.

lua
player:getItemAmount(itemID)

getLevel

Returns the player's current level.

lua
getLevel()

getLifeGoals

Returns a table with the player's Life Goal tasks.

lua
getLifeGoals()

getMod

Returns the player's mod.

lua
player:getMod(playModID)

getNetID

Returns the player's network ID.

lua
getNetID()

getOnlineStatus

Returns The Online Status.

lua
getOnlineStatus()

getOwnedWorlds

Returns a list of World IDs that the player owns.

lua
getOwnedWorlds()

getPlatform

Returns the player's platform ID (0: Win, 1: iOS, 2: macOS, 4: Android).

lua
getPlatform()

getPlaytime

Returns the player's total playtime in seconds.

lua
getPlaytime()

getRecentWorlds

Returns a list of World IDs the player recently entered.

lua
getRecentWorlds()

getRID

Returns the player's unique identifier (RID) as a string.

lua
getRID()

getRIDHistory

Returns a list of RIDs recently used by the account.

lua
getRIDHistory()

getRole

Returns the player's role object (contains flags, priority, name, etc).

lua
getRole()

getRoleQuestLevel

Gets the player's role quest level for a specific type.

lua
player:getRoleQuestLevel(type)

getSmallLockedWorlds

Returns a list of World IDs locked by the player using Small/Big/Huge locks.

lua
getSmallLockedWorlds()

getSubscription

Returns the player's specified subscription status.

lua
player:getSubscription(subscription)

getTransformProfileButtons

Returns Player's TransformProfile Buttons.

lua
getTransformProfileButtons()

getType

Returns the player's type. Non-zero means it is an NPC. Lua-spawned NPCs will have a type of 25.

lua
getType()

getUnlockedAchievementsCount

Returns the number of achievements the player has unlocked.

lua
getUnlockedAchievementsCount()

getUserID

Returns the player's unique user ID.

lua
getUserID()

getWorld

Returns the world object the player is currently in.

lua
getWorld()

getWorldName

Returns the name of the world the player is currently in.

lua
getWorldName()

hasActiveBlessing

Checks if a player has an active blessing. Returns false if the power orb is disabled.

lua
player:hasActiveBlessing(blessing_id)

hasBlessing

Checks if a player has a blessing, regardless of power orb state.

lua
player:hasBlessing(blessing_id)

hasRole

Checks if the player has a specific role ID. (e.g., Roles.ROLE_ADMIN).

lua
player:hasRole(role)

hasTitle

Checks if the player has unlocked a specific title.

lua
player:hasTitle(id)

isFacingLeft

Returns true if the player is facing left.

lua
isFacingLeft()

isMaxInventorySpace

Returns true if the player's inventory is full.

lua
isMaxInventorySpace()

isOnline

Checks if the player object corresponds to an online player.

lua
isOnline()

onAchievementsUI

Shows the achievements UI for a target player.

lua
player:onAchievementsUI(targetPlayer)

onBackpackUI

Shows the Backpack UI for a target player.

lua
player:onBackpackUI(targetPlayer)

onBillboardUI

Shows the Billboard UI.

lua
onBillboardUI()

onClothesUI

Shows the clothing UI of a target player.

lua
player:onClothesUI(targetPlayer)

onCoinsBankUI

Shows the Coins Bank UI.

lua
onCoinsBankUI()

onConsoleMessage

Sends a message to the player's in-game console.

lua
player:onConsoleMessage(message)

onDialogRequest

Sends a dialog to the player. The callback function is optional and handles the response directly.

lua
player:onDialogRequest(dialogString, delay, callback)

onFavItemsUI

Shows the Favorite Items UI.

lua
onFavItemsUI()

onGrow4GoodDonate

Fires Grow4GoodDonate Event.

lua
onGrow4GoodDonate()

onGrow4GoodUI

Shows the Grow4Good UI.

lua
onGrow4GoodUI()

onGrowmojiUI

Shows the Growmoji UI.

lua
onGrowmojiUI()

onGrowpassUI

Shows the Growpass UI.

lua
onGrowpassUI()

onGuildNotebookUI

Returns The GuildNotebook UI.

lua
onGuildNotebookUI()

onLinkDiscordUI

Shows the Link Discord UI.

lua
onLinkDiscordUI()

onMentorshipUI

Shows the Mentorship UI.

lua
onMentorshipUI()

onNameIconsUI

Shows the Name Icons UI for a target player.

lua
player:onNameIconsUI(targetPlayer)

onNotebookUI

Shows the Notebook UI.

lua
onNotebookUI()

onOnlineStatusUI

Shows the Online Status UI.

lua
onOnlineStatusUI()

onPersonalizeWrenchUI

Shows the Personalize Wrench UI.

lua
onPersonalizeWrenchUI()

onRedeemMenu

Sends a redeem menu to the player.

lua
onRedeemMenu()

onStorePurchaseResult

Sends a store purchase result to the player.

lua
onStorePurchaseResult()

onTalkBubble

Displays a talk bubble above a player. Use player:getNetID() for self.

lua
player:onTalkBubble(netID, message, isApi)

onTextOverlay

Displays a large text overlay on the player's screen.

lua
player:onTextOverlay(text)

onTitlesUI

Shows the titles UI for a target player.

lua
player:onTitlesUI(targetPlayer)

onTradeScanUI

Shows the trade scan UI.

lua
onTradeScanUI()

onUnlinkDiscordUI

Shows the Unlink Discord UI.

lua
onUnlinkDiscordUI()

onVouchersUI

Shows the Vouchers UI.

lua
onVouchersUI()

onWrenchIconsUI

Shows the Wrench Icons UI for a target player.

lua
player:onWrenchIconsUI(targetPlayer)

playAudio

Plays an audio file for the player (e.g., "audio/ding.wav").

lua
player:playAudio(filePath, delay)

removeBankBalance

Removes from the player's bank balance.

lua
player:removeBankBalance(amount)

removeBlessing

Removes a blessing from a player.

lua
player:removeBlessing(blessing_id)

removeCoins

Removes coins from the player.

lua
player:removeCoins(amount, sendPacket)

removeFriend

Removes a friend. Also updates the friend's list.

lua
player:removeFriend(targetPlayer)

removeGems

Removes a specified amount of gems from the player.

lua
player:removeGems(amount, sendPacket, isDisplay)

removeLevel

Removes a specified number of levels from the player.

lua
player:removeLevel(amount)

removeMod

Removes a modification from the player.

lua
player:removeMod(modID)

removeTitle

Removes a title from the player.

lua
player:removeTitle(id)

removeXP

Removes a specific amount of experience points from the player.

lua
player:removeXP(amount)

resetDialogColor

Resets dialog colors to default. Must be called after using custom colors.

lua
resetDialogColor()

resetNickname

Resets the player's display name to their original name.

lua
resetNickname()

sendAction

Sends a default Growtopia action string (e.g., for sound effects like action|play_sfx...).

lua
player:sendAction(actionString)

sendVariant

Sends a raw variant packet to the player. Examples: {"OnTalkBubble", netID, "Msg"}, {"OnConsoleMessage", "Msg"}, {"OnCountdownStart", 60, -1}. Advanced use.

lua
player:sendVariant(variantTable, delay, netID)

setBankBalance

Sets the player's bank balance to a specific value.

lua
player:setBankBalance(amount)

setBroadcastWorld

Sets the custom broadcast world for this specific player.

lua
player:setBroadcastWorld(worldName)

setCoins

Sets the player's coin count to a specific value.

lua
player:setCoins(amount)

setCountry

Changes the country flag of a player. Example: player:setCountry("us").

lua
player:setCountry(countryCode)

setCountryFlagBackground

Sets the player's country flag background item. Use 0 to remove.

lua
player:setCountryFlagBackground(item_id)

setCountryFlagForeground

Sets the player's country flag foreground item. Use 0 to remove.

lua
player:setCountryFlagForeground(item_id)

setGems

Sets the player's gem count to a specific value.

lua
player:setGems(amount)

setLevel

Sets the player's level to a specific value.

lua
player:setLevel(level)

setNextDialogBorderRGBA

Sets the border color of the next dialog.

lua
player:setNextDialogBorderRGBA(r, g, b, a)

setNextDialogRGBA

Sets the background color of the next dialog.

lua
player:setNextDialogRGBA(r, g, b, a)

setNickname

Sets the player's display name. Now supports all characters and persists after relogin.

lua
player:setNickname(name)

setPassword

Sets the player's account password.

lua
player:setPassword(newPassword)

setRole

Sets the player's role ID.

lua
player:setRole(role)

setRoleQuestLevel

Sets the player's role quest level for a specific type (e.g., PlayerRoleQuestTypes.Farmer).

lua
player:setRoleQuestLevel(type, level)

setXP

Sets the player's total experience points to a specific value.

lua
player:setXP(amount)

upgradeInventorySpace

Upgrades the player's inventory space.

lua
player:upgradeInventorySpace(amount)

Released under the MIT License.