Skip to main content
Typed entity objects with runtime schema field access.

Field access

pawn.m_iHealth and pawn["m_iHealth"] both work. Assignment writes straight to game memory: pawn.m_flVelocityModifier = 1.0. Unknown fields, unsupported types, and protected memory access raise errors. Writable: booleans, numbers, Vector/QAngle (assign a typed object or the {x=,y=,z=} / {pitch=,yaw=,roll=} table). Everything else is read-only. int64 and uint64 use Lua numbers and are exact only through 2^53.

Object properties

GetLocalPlayer

Local pawn as an entity object, or nil when not spawned.

GetLocalPlayerOrSpec

Returns the local pawn, or the spectated pawn while observing.

GetLocalController

Local controller, or nil.

players / controllers

Iterates every connected player’s pawn / controller as entity objects. Skips empty slots and unresolvable handles.

GetEyePosition

Returns the player’s eye Vector (origin + view offset), or nil for non-player entities.

IsAlive

Returns true if the entity has health > 0.

IsEnemy

Returns true if the entity is an enemy of the local player. Respects mp_teammates_are_enemies. Returns false when there is no local pawn or the entity isn’t a player pawn.

GetWeaponData

The weapon’s CCSWeaponBaseVData as an entity object, or nil. Pass a player pawn for its active weapon, or a weapon entity directly. Weapon stats such as damage, penetration, range, armor ratio, and max speed live on this object.

GetWeaponType

Same argument as GetWeaponData. Returns a number, or nil. Use this helper because schema enum fields are not supported by direct field access.

Cast

Wraps any address (e.g. from cheat.FindPattern) or re-types an existing object. Errors on unknown class names. Returns nil for a null address.
Entity objects hold raw pointers. Re-fetch them each tick to avoid stale pointers.
Handles and entity-list results use the runtime class. Pointer fields use their declared class. Use :Cast for derived fields. Unknown pointer classes return plain addresses.