Counter Strike Online Wiki
Advertisement

Player and monster parent objects

All of the variables and functions defined here can also be used in players and monsters.


Tables[]

Game.Entity.position[]

Data type representing specific block coordinates
Fields:
  • x: (int) x coordinate
  • y: (int) y coordinate
  • z: (int) z coordinate


Game.Entity.velocity[]

Data type representing a specific speed
Fields:
  • x: (number) x axis speed
  • y: (number) y axis speed
  • z: (number) z axis speed


Game.Entity.color[]

Color type
Fields:
  • r: (int) red color (0 ~ 255)
  • g: (int) green color (0 ~ 255)
  • b: (int) blue color (0 ~ 255)


Fields[]

Game.Entity.index[]

Get the index number of the entity.
The index starts at 1.
  • index: (int)


Game.Entity.user[]

A table that can store arbitrary data.


Game.Entity.health[]

Gets or changes an entity's health.
If you change it to a value greater than the maximum health, the maximum health also increases.
You can change from 1 to 1000000.
  • health: (int)


Game.Entity.maxhealth[]

Gets or changes the maximum health of the entity.
If you change the value to less than the current health, the current health will also decrease.
You can change from 1 to 1000000.
  • maxhealth: (int)


Game.Entity.armor[]

Gets or changes an entity's body armor.
If you change it to a value greater than the maximum body armor, the maximum body armor will increase at the same time.
You can change from 0 to 1000000.
  • armor: (int)


Game.Entity.maxarmor[]

Gets or changes an entity's maximum body armor.
If you change it to a smaller value than the current body armor, the current body armor also decreases at the same time.
You can change from 0 to 1000000.
  • maxarmor: (int)

Game.Entity.position[]

Gets or changes the entity's located block coordinates.
If you change to a non-movable area, nothing happens.
Usage:
player.position = {x = 10 , y = -25 , z = 0 }


Game.Entity.velocity[]

Gets or changes the speed of an entity.
Only part of it can be changed.
Usage:'
player.velocity = {x = 0 , y = 10.5 , z = 100.0 } 
player.velocity = {z = 100.0 }


Methods[]

Game.Entity: GetEntityType ()[]

Get the entity type.
You can see if the entity is a player or a monster.
Returns:
(Game.ENTITYTYPE) entity type


Game.Entity: IsMonster ()[]

Check if the entity is a monster.
Returns:
(bool) Return true for monsters


Game.Entity: IsPlayer ()[]

Check if the entity is a player.
Returns:
(bool) Return true for player


Game.Entity: ToMonster ()[]

Entities are converted to monsters and imported.
Returns:
(Game.Monster or nil) if not a monster, nil


Game.Entity: ToPlayer ()[]

Entity is converted to player and imported.
Returns:
(Game.Player or nil) if not player, nil


Game.Entity: ShowOverheadDamage (damage, playerIndex)[]

Shows damage above the entity's head.
Parameters:
  • damage: (number) Damage to display
  • playerIndex (int) The index of the player whose display is visible. If 0, it is displayed to everyone.


Game.Entity: SetRenderFX (fx)[]

Set effects on the entity model.
Parameters:


Game.Entity: SetRenderColor (color)[]

Sets the color of the entity model.
Parameters:
Advertisement