Player Functions
playerfunctions.lua
This module contains helper functions for manipulating player states, interactions, and utility checks.
instantLookEnt(ent, ent2)
Instantly turns an entity to face a target (entity or coordinates) without animation.
Example:
lookEnt(entity)
Makes the current player look toward the given entity.
Usually called after when opening a menu or something similar to make the player visually face the location
Example:
setThirst(src, thirst)
Server Side Only
Sets the thirst level of a player.
Example:
setHunger(src, hunger)
Server Side Only
Sets the hunger level of a player.
Example:
chargePlayer(cost, moneyType, newsrc)
Server Side Only
Deducts money from a player of the specified type (cash
, bank
, etc).
Example:
fundPlayer(fund, moneyType, newsrc)
Server Side Only
Adds money to a player's balance of a given type.
Example:
ConsumeSuccess(itemName, type, data)
Handles logic when an item is successfully consumed (e.g., food, drink, etc).
Supports hunger and thirst info directly from table eg. { hunger = 10, thirst = 20 }
Example:
hasJob(job, source, grade)
Checks if a player has a certain job and optionally checks for a specific grade.
Similar to jobCheck()
but also retrieves as much player job info as possible
Example:
getPlayer(source)
Retrieves basic player information (name, cash, bank, job, etc.) based on the active core/inventory system.
Can be called server-side (passing a player source) or client-side (for current player).
Called often in my scripts as its makes use of frameworks "GetPlayerData" etc.
Example:
GetPlayersFromCoords(coords, radius)
Returns a list of players within a specified radius of a set of coordinates.
Example:
Last updated