ent:IsValid():booleanWhether the entity is valid.
In-game entity: players, weapons, buildings, props.
ent:IsValid():booleanWhether the entity is valid.
ent:IsNull():booleanWhether the wrapped pointer is null.
ent:GetIndex():numberEntity index.
ent:GetClassId():numberNetwork class ID.
ent:GetClassName():stringNetwork class name string.
ent:GetTeam():numberTeam number.
ent:GetTeamNumber():numberTeam number; alias of GetTeam.
ent:GetAbsOrigin():Vector3World position of the entity.
ent:GetAbsAngles():Vector3World angles of the entity.
ent:GetCenter():Vector3Center of the entity's bounds.
ent:GetEyePosition():Vector3Eye position for players.
ent:GetShootPos():Vector3Muzzle or eye position used to fire.
ent:IsDormant():booleanWhether the entity is dormant.
ent:IsPlayer():booleanWhether the entity is a player.
ent:IsBuilding():booleanWhether the entity is a building.
ent:IsProjectile():booleanWhether the entity is a projectile.
ent:IsNPC():booleanWhether the entity is an NPC.
ent:IsWeapon():booleanWhether the entity is a weapon.
ent:IsAlive():booleanWhether the entity is alive.
ent:GetHealth():numberCurrent health.
ent:GetMaxHealth():numberMaximum health.
ent:GetClass():stringClient class string, for example CTFPlayer.
ent:GetVelocity():Vector3Current velocity.
ent:GetEyeAngles():Vector3Eye angles for players.
ent:InCond(cond:number):booleanWhether the player has a condition flag set.
ent:IsInvisible():booleanWhether the player is invisible.
ent:IsUbered():booleanWhether the player is ubercharged.
ent:IsCritBoosted():booleanWhether the player is crit boosted.
ent:IsMiniCritBoosted():booleanWhether the player is minicrit boosted.
ent:IsTaunting():booleanWhether the player is taunting.
ent:GetCritMult():numberCurrent crit multiplier.
ent:GetPropInt(name:string, table?:string):numberRead an int netvar by name; nil when absent.
ent:GetPropFloat(name:string, table?:string):numberRead a float netvar by name; nil when absent.
ent:GetPropBool(name:string, table?:string):booleanRead a bool netvar by name; nil when absent.
ent:GetPropVector(name:string, table?:string):Vector3Read a vector netvar by name; nil when absent.
ent:GetPropString(name:string, table?:string):stringRead a string netvar by name; nil when absent.
ent:GetPropEntity(name:string):EntityRead an entity netvar by name.
ent:GetPropDataTableInt(name:string):numberAlias of GetPropInt.
ent:GetPropDataTableFloat(name:string):numberAlias of GetPropFloat.
ent:GetPropDataTableBool(name:string):booleanAlias of GetPropBool.
ent:GetPropDataTableVector(name:string):Vector3Alias of GetPropVector.
ent:GetPropDataTableString(name:string):stringAlias of GetPropString.
ent:SetPropInt(name:string, value:number):booleanWrite an int netvar; false when not found.
ent:SetPropFloat(name:string, value:number):booleanWrite a float netvar; false when not found.
ent:SetPropBool(name:string, value:boolean):booleanWrite a bool netvar; false when not found.
ent:SetPropVector(name:string, value:Vector3):booleanWrite a vector netvar; false when not found.
ent:GetName():stringPlayer name string.
ent:GetMins():Vector3Minimum of the entity's bounding box.
ent:GetMaxs():Vector3Maximum of the entity's bounding box.
ent:GetMoveType():numberMove type constant.
ent:EstimateAbsVelocity():Vector3Estimated absolute velocity.
ent:SetAbsOrigin(pos:Vector3)Teleport the entity to a position.
ent:SetAbsAngles(ang:Vector3)Set the entity's world angles.
ent:GetModel():ModelThe entity's model.
ent:SetModel(path:string):booleanSwap the entity's model; false when the model index is unknown.
ent:GetVAngles():Vector3View angles of the entity.
ent:SetVAngles(ang:Vector3)Set the entity's view angles.
ent:AddCond(cond:number)Add a condition flag.
ent:RemoveCond(cond:number)Remove a condition flag.
ent:IsInFreezecam():booleanWhether the player is in freezecam.
ent:GetCarryingRuneType():numberRune type the player is carrying.
ent:GetMaxBuffedHealth():numberMaximum health including overheal.
ent:GetInvisibility():numberInvisibility scaled to 0..255 (m_flInvisibility * 255).
ent:SetPropEntity(name:string, value:Entity)Write an entity netvar.
ent:SetupBones(mask?:number, time?:number):tableBone matrix for the entity at a time.
ent:GetHitboxes(time?:number):tableHitbox list for the entity.
ent:IsMeleeWeapon():booleanWhether the weapon is melee.
ent:IsMedigun():booleanWhether the weapon is a medigun.
ent:IsShootingWeapon():booleanWhether the weapon fires projectiles or bullets.
ent:CanRandomCrit():booleanWhether the weapon can randomly crit.
ent:GetLoadoutSlot():numberLoadout slot of the weapon.
ent:GetWeaponID():numberTF weapon ID.
ent:IsViewModelFlipped():booleanWhether the viewmodel is flipped.
ent:GetWeaponProjectileType():numberProjectile type the weapon fires.
ent:GetProjectileSpeed():numberMuzzle velocity of the projectile.
ent:GetProjectileGravity():numberGravity scale applied to the projectile.
ent:GetWeaponSpread():numberWeapon spread value.
ent:GetWeaponBaseDamage():numberBase damage of the weapon.
ent:GetSwingRange():numberMelee swing range.
ent:GetCritTokenBucket():numberCrit token bucket value.
ent:GetCritCheckCount():numberCrit check counter.
ent:GetCritSeedRequestCount():numberCrit seed request counter.
ent:GetCurrentCritSeed():numberCurrent crit seed.
ent:GetRapidFireCritTime():numberRapid fire crit time.
ent:GetLastRapidFireCritCheckTime():numberLast rapid fire crit check time.
ent:GetCritChance():numberCurrent crit chance.
ent:IsAttackCritical():booleanWhether the next attack is a crit.
ent:GetWeaponData():tableWeapon data table, or nil when unavailable.
Press HOME to print your active weapon and its current clip.
callbacks.Register("CreateMove", function()
if not input.IsButtonPressed(KEY_HOME) then return end
local me = client.GetLocalPlayer()
if not me:IsValid() then return end
local wep = me:GetPropEntity("m_hActiveWeapon")
if wep and wep:IsValid() then
print(string.format("weapon: %s, clip %d/%d",
wep:GetName(), wep:GetPropInt("m_iClip1"), wep:GetPropInt("m_iClip2")))
end
end)