Read and change the cheat's own settings, watch what its features are doing, and add to the player overlay.
A script is part of the cheat, and the cheat's features are open to it. A script can read any setting, change it, watch the state of the doubletap and the anti-aim, and put its own lines next to the boxes the player overlay draws.
Every setting in the menu - and some that have no widget - has a category and a name: the heading it is filed under and its label, the same two strings the config files use. They are lowercase, such as "ragebot" and "doubletap". You do not have to guess them: a script can list them.
for _, category in ipairs( cheat.categories( ) ) do
print( category )
end
for _, setting in ipairs( cheat.list( "ragebot" ) ) do
print( setting.name, setting.type )
end
#cheat.get( category, name ) → value | nil, message
The current value of a setting. What you get depends on the setting's type:
Type
Value
"toggle", "bool"
a boolean
"int", "byte", "float"
a number - sliders, choices and counters are of these types
Answers nil and a message when there is no such setting.
local enabled = cheat.get( "ragebot", "enabled" ) -- true or false
#cheat.set( category, name, value ) → true | false, message
Changes a setting. The value has to suit the setting's type - a boolean for a toggle, a number for a slider, a colour for a colour - otherwise nothing changes and the answer is false with a message such as expected a boolean. A setting that cannot be written from a script says so the same way.
A change takes effect immediately, in the same way as if it had been made in the menu, and it stays: it is part of the cheat's state from then on and goes into a config if one is saved.
For a toggle with a hotkey: { key, key_name, mode, active } - the virtual key, its name, the mode ("toggle", "hold", "hold_off") and whether the bind is active right now. nil for settings that are not toggles. key is 0 when no key is bound.
Binds a key to a toggle; a key of 0 removes the bind. mode is "toggle", "hold" or "hold_off"; leave it out to keep the current one. Raises an error on a setting that is not a toggle.
local doubletap = cheat.find( "ragebot", "doubletap" )
if doubletap then
doubletap:set_bind( input.vk.mouse4, "hold" )
end
The cheat's player overlay draws a box, bars, a name, a weapon and flags around each player. The esp event lets a script add to that: it runs once for each player, right after the built-in elements, with the player and an esp object that places new lines, bars and icons around the player's box next to what is already there - below the last text line on a side, beyond the last bar - instead of on top of it.
on( "esp", function( player, esp )
if not esp:enemy( ) then return end
esp:text( "top", player:weapon( ):weapon_name( ), color( 255, 255, 255 ) )
esp:bar( "left", player:armor( ) / 100, color( 90, 160, 255 ) )
end )
The object is only valid inside the handler. Everywhere a side is wanted it is one of "left", "top", "bottom" or "right".
A line of text on a side of the box, outlined for legibility. Lines on the top and bottom are centred on the box; lines on the left and right stack down the side, one under the other, starting below whatever the overlay put there. options.font is a font; the default is the cheat's small pixel font.
A bar along a side of the box, filled to fraction (0 to 1). It is stacked with the overlay's own bars: a bar on the left goes outside the health bar, not over it. options:
A picture beside the box - a texture or a render.icon. size is the width in pixels (the height follows the picture's proportions); without it the picture's own size is used. A texture that is not ready yet is skipped.