User & Character Functions¶
GetUser(aIndex)¶
Returns the GameObject for the given player index, or nil if not connected. Uses an internal cache for performance.
local player = GetUser(aIndex)
if player then
LogAdd(LOG_BLUE, "Player: " .. player.Name .. " Level: " .. player.Level)
end
UserLogOut(aIndex)¶
Initiates a graceful logout (5-second countdown) for the player.
- Returns:
boolean
UserDisconnect(aIndex, type)¶
Immediately disconnects the player.
- Returns:
boolean
UserLogOutByName(name)¶
Graceful logout by character name.
- Returns:
boolean
UserDisconnectByName(name, type)¶
Immediate disconnect by character name.
- Returns:
boolean
UserKick(aIndex, reason)¶
Disconnects a player with an optional notice message.
- Returns:
boolean
UserKickByName(name, reason)¶
Kicks a player by name with an optional reason.
- Returns:
boolean
gObjAllLogOut()¶
Initiates logout for all connected players.
gObjAllDisconnect(type)¶
Disconnects all players immediately.
UserCalcAttribute(aIndex)¶
Recalculates all attributes (stats, damage, defense, etc.) for the player.
- Returns:
boolean
UserInfoSend(aIndex)¶
Recalculates attributes and refreshes the player's viewport (appearance update).
- Returns:
boolean
LevelUpSend(aIndex)¶
Recalculates attributes and sends a level-up notification to the client.
- Returns:
boolean
MasterLevelUpSend(aIndex)¶
Recalculates attributes and sends a Master Level-up notification.
- Returns:
boolean
player.MasterLevel = player.MasterLevel + 1
player.MasterPoint = player.MasterPoint + 1
MasterLevelUpSend(aIndex)
PKLevelSend(aIndex, pkLevel)¶
Sets the PK level and sends a visual update to the client. Pass -1 to just refresh.
- Returns:
boolean
gObjDel(aIndex)¶
Deletes an object from the server (use for monsters/NPCs, not players).
- Returns:
number
gObjAuthorityCodeSet(aIndex, code)¶
Sets the authority/permission code for a player.
gObjAccountLevelExpireProc(lpObj)¶
Processes account level expiration for VIP/premium accounts.
gObjRebuildMasterSkillTree(lpObj)¶
Rebuilds the Master Skill Tree for the player (use after modifying master skills).
CashShopAddPoint(aIndex, WC, WP, GP)¶
Adds Cash Shop currency points to the player.
Help