Skip to content

Player

getIP

Returns the player's IP address as a string.

lua
player:getIP()

getMod

Returns the player's mod.

lua
player:getMod(playModID)

getRID

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

lua
player:getRID()

getGems

Returns the player's gem count.

lua
player:getGems()

getPing

Returns the player's ping in milliseconds.

lua
player:getPing()

getRole

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

lua
player:getRole()

getType

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

lua
player:getType()

getCoins

Returns the player's coin count.

lua
player:getCoins()

getEmail

Returns the player's email address.

lua
player:getEmail()

getLevel

Returns the player's current level.

lua
player:getLevel()

getNetID

Returns the player's network ID.

lua
player:getNetID()

getWorld

Returns the world object the player is currently in.

lua
player:getWorld()

getGender

Returns the player's gender.

lua
player:getGender()

getUserID

Returns the player's unique user ID.

lua
player:getUserID()

getCountry

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

lua
player:getCountry()

getFriends

Returns a table with friend user IDs.

lua
player:getFriends()

getGuildID

Returns the Guild ID.

lua
player:getGuildID()

getPlatform

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

lua
player:getPlatform()

getPlaytime

Returns the player's total playtime in seconds.

lua
player:getPlaytime()

getCleanName

Returns the player's name without any special formatting.

lua
player:getCleanName()

getDiscordID

Returns the Player's Discord ID.

lua
player:getDiscordID()

getIPHistory

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

lua
player:getIPHistory()

getLifeGoals

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

lua
player:getLifeGoals()

getWorldName

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

lua
player:getWorldName()

getItemAmount

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

lua
player:getItemAmount(itemID)

getRIDHistory

Returns a list of RIDs recently used by the account.

lua
player:getRIDHistory()

getAltAccounts

Returns an array of alternative accounts linked to this player.

lua
player:getAltAccounts()

getBankBalance

Returns the player's bank balance.

lua
player:getBankBalance()

getHomeWorldID

Returns Player's Home World ID.

lua
player:getHomeWorldID()

getOwnedWorlds

Returns a list of World IDs that the player owns.

lua
player:getOwnedWorlds()

getAccessWorlds

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

lua
player:getAccessWorlds()

getOnlineStatus

Returns The Online Status.

lua
player:getOnlineStatus()

getRecentWorlds

Returns a list of World IDs the player recently entered.

lua
player:getRecentWorlds()

getSubscription

Returns the player's specified subscription status.

lua
player:getSubscription(subscription)

getBackpackItems

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

lua
player:getBackpackItems()

getInventorySize

Returns the player's inventory size.

lua
player:getInventorySize()

getBiweeklyQuests

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

lua
player:getBiweeklyQuests()

getClothingItemID

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

lua
player:getClothingItemID(slot)

getDiscordInvites

Returns the number of Discord invites a player has.

lua
player:getDiscordInvites()

getDungeonScrolls

Returns the number of dungeon scrolls a player has.

lua
player:getDungeonScrolls()

getInventoryItems

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

lua
player:getInventoryItems()

getRoleQuestLevel

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

lua
player:getRoleQuestLevel(type)

getBackpackUsedSize

Returns the number of used slots in the backpack.

lua
player:getBackpackUsedSize()

getAchievementsCount

Returns the total number of available achievements.

lua
player:getAchievementsCount()

getSmallLockedWorlds

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

lua
player:getSmallLockedWorlds()

getAdjustedBlockHitCount

Returns the current adjusted block hit count value.

lua
player:getAdjustedBlockHitCount()

getClassicProfileContent

Returns the ClassicProfile Content.

lua
player:getClassicProfileContent(cat, flags)

getCountryFlagBackground

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

lua
player:getCountryFlagBackground()

getCountryFlagForeground

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

lua
player:getCountryFlagForeground()

getAccountCreationDateStr

Returns the Account Creation Date.

lua
player:getAccountCreationDateStr()

getTransformProfileButtons

Returns Player's TransformProfile Buttons.

lua
player:getTransformProfileButtons()

getUnlockedAchievementsCount

Returns the number of achievements the player has unlocked.

lua
player:getUnlockedAchievementsCount()

setXP

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

lua
player:setXP(amount)

setGems

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

lua
player:setGems(amount)

setRole

Sets the player's role ID.

lua
player:setRole(role)

setCoins

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

lua
player:setCoins(amount)

setLevel

Sets the player's level to a specific value.

lua
player:setLevel(level)

setStats

Sets a specific player stat.

lua
player:setStats(type, amount)

setCountry

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

lua
player:setCountry(countryCode)

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)

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)

setDungeonScrolls

Sets the number of dungeon scrolls a player has (max 255).

lua
player:setDungeonScrolls(amount)

setNextDialogRGBA

Sets the background color of the next dialog.

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

setRoleQuestLevel

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

lua
player:setRoleQuestLevel(type, level)

setNextDialogBorderRGBA

Sets the border color of the next dialog.

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

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)

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)

addMod

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

lua
player:addMod(modID, durationSeconds)

addGems

Adds a specified amount of gems to the player.

lua
player:addGems(amount, sendPacket, isDisplay)

addMail

Adds a new mail to the player's mailbox.

lua
player:addMail(mailDataTable)

hasRole

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

lua
player:hasRole(role)

addCoins

Adds coins to the player.

lua
player:addCoins(amount, sendPacket)

addLevel

Adds a specified number of levels to the player.

lua
player:addLevel(amount)

addTitle

Adds a title to the player.

lua
player:addTitle(id)

doAction

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

lua
player:doAction(actionString)

hasTitle

Checks if the player has unlocked a specific title.

lua
player:hasTitle(id)

isOnline

Checks if the player object corresponds to an online player.

lua
player:isOnline()

removeXP

Removes a specific amount of experience points from the player.

lua
player:removeXP(amount)

addFriend

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

lua
player:addFriend(targetPlayer)

playAudio

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

lua
player:playAudio(filePath, delay)

removeMod

Removes a modification from the player.

lua
player:removeMod(modID)

changeItem

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

lua
player:changeItem(itemID, amount, isSendPacket)

disconnect

Disconnects the player from the server.

lua
player:disconnect()

enterWorld

Teleports the player to a specified world.

lua
player:enterWorld(worldName, doorID)

onTitlesUI

Shows the titles UI for a target player.

lua
player:onTitlesUI(targetPlayer)

removeGems

Removes a specified amount of gems from the player.

lua
player:removeGems(amount, sendPacket, isDisplay)

sendAction

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

lua
player:sendAction(actionString)

addBlessing

Adds a blessing to a player.

lua
player:addBlessing(blessing_id)

hasBlessing

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

lua
player:hasBlessing(blessing_id)

onClothesUI

Shows the clothing UI of a target player.

lua
player:onClothesUI(targetPlayer)

removeCoins

Removes coins from the player.

lua
player:removeCoins(amount, sendPacket)

removeLevel

Removes a specified number of levels from the player.

lua
player:removeLevel(amount)

removeTitle

Removes a title from the player.

lua
player:removeTitle(id)

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)

clearMailbox

Clears all mail from the player's mailbox.

lua
player:clearMailbox()

isFacingLeft

Returns true if the player is facing left.

lua
player:isFacingLeft()

onBackpackUI

Shows the Backpack UI for a target player.

lua
player:onBackpackUI(targetPlayer)

onFavItemsUI

Shows the Favorite Items UI.

lua
player:onFavItemsUI()

onGrowmojiUI

Shows the Growmoji UI.

lua
player:onGrowmojiUI()

onGrowpassUI

Shows the Growpass UI.

lua
player:onGrowpassUI()

onNotebookUI

Shows the Notebook UI.

lua
player:onNotebookUI()

onRedeemMenu

Sends a redeem menu to the player.

lua
player:onRedeemMenu()

onTalkBubble

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

lua
player:onTalkBubble(netID, message, isApi)

onVouchersUI

Shows the Vouchers UI.

lua
player:onVouchersUI()

removeFriend

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

lua
player:removeFriend(targetPlayer)

checkPassword

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

lua
player:checkPassword(passwordString)

onBillboardUI

Shows the Billboard UI.

lua
player:onBillboardUI()

onCoinsBankUI

Shows the Coins Bank UI.

lua
player:onCoinsBankUI()

onGrow4GoodUI

Shows the Grow4Good UI.

lua
player:onGrow4GoodUI()

onNameIconsUI

Shows the Name Icons UI for a target player.

lua
player:onNameIconsUI(targetPlayer)

onTextOverlay

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

lua
player:onTextOverlay(text)

onTradeScanUI

Shows the trade scan UI.

lua
player:onTradeScanUI()

resetNickname

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

lua
player:resetNickname()

addBankBalance

Adds to the player's bank balance.

lua
player:addBankBalance(amount)

onMentorshipUI

Shows the Mentorship UI.

lua
player:onMentorshipUI()

removeBlessing

Removes a blessing from a player.

lua
player:removeBlessing(blessing_id)

onDialogRequest

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

lua
player:onDialogRequest(dialogString, delay, callback)

onLinkDiscordUI

Shows the Link Discord UI.

lua
player:onLinkDiscordUI()

onWrenchIconsUI

Shows the Wrench Icons UI for a target player.

lua
player:onWrenchIconsUI(targetPlayer)

onAchievementsUI

Shows the achievements UI for a target player.

lua
player:onAchievementsUI(targetPlayer)

onConsoleMessage

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

lua
player:onConsoleMessage(message)

onOnlineStatusUI

Shows the Online Status UI.

lua
player:onOnlineStatusUI()

resetDialogColor

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

lua
player:resetDialogColor()

addGrowpassPoints

Adds Growpass points to a player.

lua
player:addGrowpassPoints(points)

hasActiveBlessing

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

lua
player:hasActiveBlessing(blessing_id)

onGrow4GoodDonate

Fires Grow4GoodDonate Event.

lua
player:onGrow4GoodDonate()

onGuildNotebookUI

Returns The GuildNotebook UI.

lua
player:onGuildNotebookUI()

onUnlinkDiscordUI

Shows the Unlink Discord UI.

lua
player:onUnlinkDiscordUI()

removeBankBalance

Removes from the player's bank balance.

lua
player:removeBankBalance(amount)

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)

isMaxInventorySpace

Returns true if the player's inventory is full.

lua
player:isMaxInventorySpace()

onPersonalizeWrenchUI

Shows the Personalize Wrench UI.

lua
player:onPersonalizeWrenchUI()

onStorePurchaseResult

Sends a store purchase result to the player.

lua
player:onStorePurchaseResult()

upgradeInventorySpace

Upgrades the player's inventory space.

lua
player:upgradeInventorySpace(amount)

Released under the MIT License.