Lua API
  • 🔎Overview
  • Getting started
    • 🚀Creating scripts
    • 📓Metadata
    • ☎ïļCallbacks
    • 🧠Examples
    • 🌐Useful resources
  • Documentation
    • ⚙ïļNamespaces
      • ðŸ–ĨïļGui
      • ✏ïļRender
      • 🏎ïļEngine
      • ðŸ”ĒMath
      • ⚙ïļUtilities
      • 🙎Entities
      • 📖Database
      • ðŸ–ąïļInput
      • 🌌Panorama
      • ðŸŠķMaterials
      • 📂Filesystem
      • 🗃ïļZip
    • ⚙ïļInstances
      • ⚙ïļGlobal Vars
      • ⚙ïļFatality
      • ⚙ïļGamerules
      • ⚙ïļServer
    • ⚙ïļDatatypes
      • ðŸ–Ĩïļcontrol
      • ðŸ–Ĩïļcheckbox
      • ðŸ–Ĩïļcombobox
      • ðŸ–Ĩïļcolor_picker
      • ðŸ–Ĩïļslider
      • ðŸ–Ĩïļtextbox
      • ðŸ–Ĩïļlist
      • ⚙ïļentity
      • ⚙ïļplayer_info
      • ⚙ïļweapon_info
      • ⚙ïļuser_cmd
      • ⚙ïļtrace_t
      • ⚙ïļvec3
      • ⚙ïļtimer
      • ⚙ïļcvar
      • ⚙ïļshot_info
      • ⚙ïļgame_event
      • ⚙ïļmaterial
      • ⚙ïļmaterial_var
      • ⚙ïļzip
      • ⚙ïļanimator
Powered by GitBook

ÂĐ 2025 - FATALITY

On this page
  • Functions
  • get_entity
  • get_entity_from_handle
  • for_each
  • for_each_z
  • for_each_player
  1. Documentation
  2. Namespaces

Entities

entities namespace

Functions

get_entity

entities.get_entity(engine.get_local_player())

entity index

number

entity's server index

Returns:

entity's object

get_entity_from_handle

entities.get_entity_from_handle(local_player:get_prop("m_hMyWeapons", 1))

entity handle

number

a handle to the entity ex: m_hMyWeapons[1]

Returns:

entity's object

for_each

entities.for_each(function(entity)
    print(string.format("Entity's index: %i", entity:get_index()))
end)

function callback

function

A function to use as a callback.

Must have 1 argument for the entity.

Usage:

Runs for each entity on the server.

for_each_z

entities.for_each_z(function(entity)
    print(string.format("Entity's index: %i", entity:get_index()))
end)

function callback

function

A function to use as a callback.

Must have 1 argument for the entity.

Usage:

Runs for each entity on the server starting from the end.

for_each_player

entities.for_each_player(function(player)
    print(string.format("Player: %i has %i health", 
    player:get_index(), 
    player:get_prop("m_iHealth")))
end)

function callback

function

A function to use as a callback.

Must have 1 argument for the player.

Usage:

Runs for each player on the server.

PreviousUtilitiesNextDatabase

Last updated 2 years ago

⚙ïļ
🙎
Parameter
Datatype
Description
Value
Datatype
entity
Parameter
Datatype
Description
Value
Datatype
entity
Parameter
Datatype
Description
Parameter
Datatype
Description
Parameter
Datatype
Description