Global Functions

These are all the global functions created by the game during initialization with the exclusion of ones created by Lua's standard library, as those are documented here. Do keep in mind that some of these functions are not actually present in Bully though. The io and os libraries are completely absent, and the string library is limited to a simplified string.find and string.format. Some functions (like print) are still listed here, because Bully creates its own version that overrides the original one.

There is no straight forward way to get all of the arguments and results of these Lua functions due to the nature of how they're defined. All documentation here is from a combination of experimentation and research into decompiled scripts. For that reason, take everything here with a grain of salt and know the information for each function may not be 100% accurate.

The Lua label means that a function was defined by a lua script rather than by the game itself. In most cases, this won't affect your ability to use it the same way you would any other function.


Naming Conventions

Being able to guess the arguments and results of functions is often fairly simple. This may be needed as many functions do not have detailed documentation at this time.

Most functions start with a noun (like Player or Vehicle) that says what the function is relating to, which usually indicates the what the first argument is. For example, a function like PedSetHealth takes a ped as the first argument, then the health value as the second argument. One notable exception to this rule is Player, as those functions don't take any such argument. For example, PlayerSetHealth only takes a health value, without the need to specify a player (because there is only one player in most contexts).

Most functions have only one result, which is usually indicated by the name itself. Something like PedGetHealth for example, predictably returns health value. There are only a few exceptions, most notably functions that return a position. A function like PlayerGetPosXYZ returns the player's position as 3 coordinates, representing each axis.

Any function that creates something is usually an exception to the rule of the first argument being the first noun of the name. As an example, something like PedCreateXYZ takes a model number and 3 coordinates for where to create the ped, also returning the created ped.