Skip to content

overview

The game table allows you to manage CS:GO/TF2.

moonlight.game.localweapon

Returns

  • number

moonlight.game.localplayer

Returns

  • number

moonlight.game.can_shoot

Parameters

  • number weapon

Returns

  • boolean

moonlight.game.get_entities

Returns

  • table

number address

number id

string name


moonlight.game.get_max_clients

Returns

  • number

moonlight.game.get_highest_entity_index

Returns

  • number

moonlight.game.get_entity_handle

Parameters

  • number - The entity's id or address.

Returns

  • number - The entity's handle.

moonlight.game.get_entity_id

Parameters

  • number - The entity's handle or address.

Returns

  • number - The entity's id.

moonlight.game.create_interface

Parameters

  • string interface/module
  • optional string interface

Interface/Module Arguments

  • interface_client
  • interface_engine_client
  • interface_studio_render
  • interface_surface
  • interface_vgui_panel
  • interface_prediction
  • interface_entity_list
  • interface_cvar
  • interface_engine_trace
  • interface_debug_overlay
  • interface_material_system
  • interface_input_system
  • interface_game_event_system
  • interface_weapon_system
  • interface_sound_system

Returns

  • `number - The inferface address.

Remarks

  • The Interface/Module argument must be one listed above. Otherwise, you can use the 2nd parameter like such:
local VEngineClient = moonlight.game.create_interface( "engine.dll", "VEngineClient")

moonlight.game.push_cmd

Parameters

  • number - The address of the cmd.

Remarks

  • fantasy.moonlight does not allow direct cmd modification in its callbacks. If you modify a cmd table in a callback such as OnCreateMove, you must submit the cmd using this function.
  • This function will not change x, y, z or any movement information if allow_geometric_changes is set to false in pure_mode.txt.

moonlight.game.get_globals

Returns

  • table

number absolute_frame_start_time

number frame_count

number real_time

number curtime

number frametime

number max_clients

number tick_count

number interval_per_tick

number interpolation_amount

number sim_ticks_this_frame

number network_protocol

number save_data

boolean client

boolean remote_client

number time_stamp_networking_base

number time_stamp_randomize_window


moonlight.game.get_players

Returns

  • table - The address of each player on the server.

moonlight.game.get_enemies

Returns

  • table - The address of each enemy on the server.

moonlight.game.get_teammates

Returns

  • table - The address of each teammate on the server.

moonlight.game.set_buttons

Parameters

  • number

moonlight.game.unset_buttons

Parameters

  • number

moonlight.game.cmd

Parameters

  • string - The console command.

moonlight.game.cmd_unrestricted

Parameters

  • string - The console command.

moonlight.game.update

Remarks

  • This will update the client state.

moonlight.game.is_weapon_gun

Parameters

  • number - Weapon address

Returns

  • boolean

moonlight.game.convar

Parameters

  • string - The convar's name.

Returns

  • table

string name

string help

number flags

string default_string

string string

number string_length

number float

number float_min

number float_max

number int

number int_min

number int_max


moonlight.game.set_convar

Parameters

  • string name - The convar.
  • number/string value

moonlight.game.get_crosshair

Returns

  • number - Crosshair ID

moonlight.game.get_player

Parameters

  • number entity - Entity address or ID.

Returns

  • table

If the entity is a player (CS:GO): number address

boolean is_alive

number team

number index

boolean is_dormant

number model

number class_id

string class_name

string name

string steam

string steam64

number tick_base

number health

number armor

number move_type

number flags

table velocity (number x, number y, number z)

table origin (number x, number y, number z)

table punch (number x, number y, number z)

If the entity is a player (TF2 & CSS): number address

boolean is_alive

number team

number index

boolean is_dormant

number model

number class_id

string class_name

string name

string steam

number tick_base

number health

number armor

number move_type

number flags

number conditions

number class

number max_health

table velocity (number x, number y, number z)

table origin (number x, number y, number z)

table punch (number x, number y, number z)

If the entity is not a player: number address

boolean is_alive

number team

number index

boolean is_dormant

number model

number class_id

string class_name

number health

number armor

table origin (number x, number y, number z)


moonlight.game.get_entity

Remarks

  • This does the same exact thing as moonlight.game.get_player. It mirrors the function.

moonlight.game.is_weapon_pistol

Parameters

  • number weapon - Weapon address.

Returns

  • boolean

Remarks

  • Use moonlight.game.get_weapon_data instead. The table has a type member.

moonlight.game.is_weapon_sniper

Parameters

  • number weapon - Weapon address.

Returns

  • boolean

Remarks

  • Use moonlight.game.get_weapon_data instead. The table has a type member.

moonlight.game.get_weapon_ammo

Parameters

  • number weapon - Weapon address.

Returns

  • integer

Remarks

  • Use moonlight.game.get_weapon_data instead. The table has a ammo member.

moonlight.game.get_weapon_data

Parameters

  • number weapon - Weapon address.

Returns (CS:GO)

  • table

number id

number ammo

number address

number damage

number max_clip

string hud_name

string weapon_name

number type

number kill_award

boolean auto

number armor_ratio

number bullets

number penetration

number range

number range_modifier

number silencer

number spread

number spread_alt

number recoil_seed

Returns (TF2)

  • table

number id

number ammo

number address

number slot

number charge

number charge_time

number speed

number range

number projectile_speed

number spread

number damage

Returns (CSS)

  • table

number id

number ammo

number address

number damage

number ammo_type

number armor_ratio

number bullets

number muzzle_scale

number penetration

number range

number range_modifier

Remarks

  • The type member that is returned can contain the WEAPON_TYPE_ globals found on the Globals page.

moonlight.game.is_valid_player

Parameters

  • number player - Player address or ID.

Returns

  • boolean

moonlight.game.get_flags

Parameters

  • number entity - Entity address or ID.

Returns

  • number

Remarks

  • Use moonlight.game.get_entity instead. The table returns flags member.

moonlight.game.get_fov

Parameters

  • number x
  • number y
  • number z

Returns

  • number

Remarks

  • This gets the FOV from your Viewangles to the target angle.

moonlight.game.get_latency

Parameters

  • number code

Returns

  • number

Remarks

  • TF2 Only

moonlight.game.get_abs_velocity

Parameters

  • number entity - Entity address or ID.

Returns

  • number
  • number
  • number

Remarks

  • TF2 Only

moonlight.game.set_view_angles

Parameters

  • number x
  • number y
  • number z

moonlight.game.get_eye_position

Parameters

  • number entity - Entity address or ID.

Returns

  • table

number x

number y

number z


moonlight.game.get_vector_origin

Parameters

  • number entity - Entity address or ID.

Returns

  • table

number x

number y

number z

Remarks

  • Use moonlight.game.get_entity instead. The table returns an origin member.

moonlight.game.get_punch_angle

Parameters

  • number entity - Entity address or ID.

Returns

  • table

number x

number y

number z

Remarks

  • Use moonlight.game.get_entity instead. The table returns an punch member.

moonlight.game.get_bone_position

Parameters

  • number entity - Entity address or ID.
  • number bone

Returns

  • table

number x

number y

number z


moonlight.game.angle

Parameters

  • number x
  • number y
  • number z

Returns

  • number
  • number
  • number

Remarks

  • Angles a vector.

moonlight.game.trace_ray

Parameters

  • number x
  • number y
  • number z
  • number end_x
  • number end_y
  • number end_z
  • number mask
  • boolean skip_player

Returns

  • table

number fraction_solid

number hit_group

number physics_bone

string surface

number player

number hitbox

number fraction

table plane (number x | number y | number z)


moonlight.game.get_render_bounds

Parameters

  • number entity - Entity address or ID.

Returns

  • number
  • number
  • number
  • number
  • number
  • number

Remarks

  • This function will return the minimum and maximum XYZ of the target.
  • This function is used to create an ESP.

moonlight.game.world_to_screen

Parameters

  • number x
  • number y
  • number z

Returns

  • number
  • number
  • number

moonlight.game.get_box_dimensions

Parameters

  • number entity - Entity address or ID.

Returns

  • table

number left

number top

number right

number bottom

Remarks

  • This function will return the minimum and maximum XYZ of the target.
  • This function is used to create an ESP.

moonlight.game.is_connected

Returns

  • boolean

moonlight.game.is_ingame

Returns

  • boolean

moonlight.game.is_paused

Returns

  • boolean

Remarks

  • This isn't completely functional.

moonlight.game.lock_cursor

Parameters

  • boolean status

moonlight.game.is_third_person

Returns

  • boolean

moonlight.game.set_third_person

Parameters

  • boolean on/off
  • number x
  • number y
  • number z

moonlight.game.get_view_angles

Returns

  • number x
  • number y
  • number z