# misc

Miscellaneous API features that don't have their own table.


# Identity & screenshot

# misc.get_username(): string

misc.get_username(): string
  • Current username in the cheat.
secret.misc.get_username()

# misc.in_screenshot(): boolean

misc.in_screenshot(): boolean
  • True while a screenshot is being captured.
secret.misc.in_screenshot()

# Freecam

# misc.get_freecam_pos(): table

misc.get_freecam_pos(): table
  • Freecam position { x, y, z }. Nil if freecam is off.
local pos = secret.misc.get_freecam_pos()
if pos then print(pos.x, pos.y, pos.z) end

# misc.get_freecam_angles(): table

misc.get_freecam_angles(): table
  • Freecam view angles.

# misc.get_spectating(): number

misc.get_spectating(): number
  • Spectated player entity index, or 0 if not spectating.

# misc.start_spectating(index: number, firstperson: boolean): boolean

misc.start_spectating(index: number, firstperson: boolean): boolean
  • Start spectating a player. Requires freecam to be on and a valid alive player index (not local player). firstperson: true = first person, false = third person. Returns false if not in game, freecam off, invalid index, or target not valid.
if secret.misc.start_spectating(ply:EntIndex(), false) then
    print("Spectating " .. ply:Nick())
end

# Input

# misc.sendmouse(action: string, x?: number, y?: number)

misc.sendmouse(action: string, x?: number, y?: number)
  • Send a mouse action. action: "left" (down/up with boolean), "right" (down/up), "move" (dx, dy), "wheel" (amount).
secret.misc.sendmouse("left", true)
secret.misc.sendmouse("left", false)
secret.misc.sendmouse("move", 100, 200)
secret.misc.sendmouse("wheel", 120)

# misc.sendkey(vk: number, press: boolean)

misc.sendkey(vk: number, press: boolean)
  • Send key press or release. vk is virtual key code (e.g. 0x44 = D, 0x20 = Space).
secret.misc.sendkey(0x44, true)
secret.misc.sendkey(0x44, false)

# ESP

# misc.add_to_player_esp(index: number, text: string, color: table, position: number)

misc.add_to_player_esp(index: number, text: string, color: table, position: number)
  • Add custom text to a player's ESP. position: 0 = top, 1 = bottom, 2 = right, 3 = left. color: { r, g, b, a }.
secret.listener.add("view_render_post", "example", function()
    for _, ply in pairs(player.GetAll()) do
        secret.misc.add_to_player_esp(ply:EntIndex(), "Custom", { 255, 255, 255, 255 }, 0)
    end
end)

# misc.add_to_ent_esp(index: number, text: string, color: table, position: number)

misc.add_to_ent_esp(index: number, text: string, color: table, position: number)
  • Add custom text to an entity's ESP. Same position/color as player ESP. Scripted entities only.

# Aimbot

# misc.get_aimbot_target(): number

misc.get_aimbot_target(): number
  • Current aimbot target entity index, or nil if none.

# Console & cvars

# misc.command(cmd: string)

misc.command(cmd: string)
  • Run a console command string.

# misc.setcvar(cvar: string, value: string)

misc.setcvar(cvar: string, value: string)
  • Set a cvar to a value.

# Network

# misc.get_address(): string | false

misc.get_address(): string | false
  • Address of the current server, or false if not connected.

# misc.is_connected(): boolean

misc.is_connected(): boolean
  • True if connected to a server.

# Entity list

# misc.add_to_entity_list(entity_name: string, action: boolean)

misc.add_to_entity_list(entity_name: string, action: boolean)
  • Add (true) or remove (false) an entity from the entity list. Entity must already be in the list (scripted entities).
secret.misc.add_to_entity_list("gmod_hands", true)
secret.misc.add_to_entity_list("gmod_hands", false)

# misc.get_entity_list(): table

misc.get_entity_list(): table
  • Table of scripted entity class names to boolean (selected or not).
for name, selected in pairs(secret.misc.get_entity_list()) do
    print(name, selected)
end

# Time & misc

# misc.desync_time(): number

misc.desync_time(): number
  • Desynced time when using the desync feature.

# misc.current_charge(): number

misc.current_charge(): number
  • Current charge ticks when using tickbase shift.

# misc.get_random_source(): string

misc.get_random_source(): string
  • Random loaded Lua source file name/path. Affected by "static source" in the Lua tab.