[Client] Lua User Functions
Category: LuaScript | Subcategory: Main User Functions
Lua User Functions
These global Lua functions provide extensive access to character information, visual properties, and interaction with players and NPCs within the game client. They allow developers to query, modify, and manage characters efficiently, enhancing gameplay customization and control.
Character Basic Information
UserGetName()
Description: Returns the name of the user.
Return Value: (string) The user’s name.
UserGetIndex()
Description: Returns the unique ID of the user.
Return Value: (integer) The user’s index ID.
UserGetMap()
Description: Returns the map number where the user is located.
Return Value: (integer) The map number.
Character Position and Movement
UserPositionX()
Description: Returns the X coordinate of the user on the map.
Return Value: (integer) The adjusted X coordinate of the user.
UserPositionY()
Description: Returns the Y coordinate of the user on the map.
Return Value: (integer) The adjusted Y coordinate of the user.
Character Equipment Information
UserGetSword()
Description: Returns the ID of the sword equipped by the user.
Return Value: (integer) The sword’s ID, or -1 if not equipped.
UserGetShield()
Description: Returns the ID of the shield equipped by the user.
Return Value: (integer) The shield’s ID, or -1 if not equipped.
UserGetHelm()
Description: Returns the ID of the helm equipped by the user.
Return Value: (integer) The helm’s ID, or -1 if not equipped.
Character Class, Level, and Guild
UserGetLevel()
Description: Returns the user’s level.
Return Value: (integer) The user’s current level.
UserGetClass()
Description: Returns the basic class ID of the user.
Return Value: (integer) The user’s class ID.
UserGetGuild()
Description: Returns the guild ID associated with the user.
Return Value: (integer) The guild ID, or -1 if not in a guild.
Conclusion
These lua user functions empower Lua scripts to deeply interact with visible entities in the game client. Developers can retrieve full information about characters, control their animations, modify their positions and visual scaling, and manage player-to-player interactions like chatting, trading, and party invitations. This level of control significantly enhances the possibilities for custom UIs, automated tools, dynamic content, and player assistance systems.