IPointScript
interface in cs_script/point_script — the type of Instance.
The API provided to scripts attached to a point_script entity.
Access these functions by importing Instance from "cs_script/point_script".
CS2 build 27045800 · Steam date 2026-11-30 · platform windows-x86_64 · schema format 2.2
Members
DebugScreenText
DebugScreenText(config: { text: any, x: number, y: number, duration?: number, color?: ColorArg }): voidPrint some text to the game window. Only works in dev environments.
DebugScreenText(text: any, x: number, y: number, duration: number, color: ColorArg): voidDeprecated: This overload will be removed in a future update
DebugLine
DebugLine(config: { start: Vector, end: Vector, duration?: number, color?: ColorArg }): voidDraw a line in the world. Only works in dev environments.
DebugLine(start: Vector, end: Vector, duration: number, color: ColorArg): voidDeprecated: This overload will be removed in a future update
DebugSphere
DebugSphere(config: { center: Vector, radius: number, duration?: number, color?: ColorArg }): voidDraw a wire sphere in the world. Only works in dev environments.
DebugSphere(center: Vector, radius: number, duration: number, color: ColorArg): voidDeprecated: This overload will be removed in a future update
DebugBox
DebugBox(config: { mins: Vector, maxs: Vector, duration?: number, color?: ColorArg }): voidDraw an axis aligned box in the world. Only works in dev environments.
DebugBox(mins: Vector, maxs: Vector, duration: number, color: ColorArg): voidDeprecated: This overload will be removed in a future update
OnScriptReload
OnScriptReload<T>(config: { before?: () => T, after?: (memory: T) => void }): voidCalled in Tools mode when the script is reloaded due to changes.
The before callback will be invoked before pre-load teardown.
The after callback will be invoked after the new script is evaluated and will be passed the return value of the before callback.
SetSaveData
SetSaveData(data: string): voidWrites save data associated with this workshop addon.
Will synchronously write to disk every time this is called.
GetSaveData
GetSaveData(): stringRetrieves the save data associated with this workshop addon.
Will synchronously read from disk the first time this is called.
SetThink
SetThink(callback: () => void): voidCalled at a specified time. Control when this is run using SetNextThink.
SetNextThink
SetNextThink(time: number): voidSet when the OnThink callback should next be run. The exact time will be on the tick nearest to the specified time, which may be earlier or later.
Delay
Delay(delay: number): Promise<void>Returns a promise that resolves after delay number of seconds. The exact time will be on the tick nearest to the specified delay, which may be earlier or later.
QueueAfterThinks
QueueAfterThinks(callback: () => void): voidQueue up a callback to be invoked once, after all entities have executed their think functions this tick (eg. player input has been handled, projectiles have moved).
This can be useful for delaying until a clean moment when an entity isn't mid-computation and might ignore or misinterpret.
This can be useful for delaying until the world is in a consistent state.
Callbacks queued up during a post entity think callback will be invoked in the same tick.
OnActivate
OnActivate(callback: () => void): voidCalled when the point_script entity is activated
OnScriptInput
OnScriptInput(name: string, callback: (inputData: { caller?: Entity, activator?: Entity }) => void): voidCalled when input RunScriptInput is triggered on the point_script entity with a parameter value that matches name.
OnPlayerConnect
OnPlayerConnect(callback: (event: { player: CSPlayerController }) => void): voidCalled when a client finishes the initial connection handshake with the server.
Same moment as game event player_connect unverified.
OnPlayerActivate
OnPlayerActivate(callback: (event: { player: CSPlayerController }) => void): voidCalled when a client finishes loading and is ready to spawn.
Same moment as game event player_activate unverified.
OnPlayerDisconnect
OnPlayerDisconnect(callback: (event: { playerSlot: number }) => void): voidCalled when a client disconnects from the server.
Same moment as game event player_disconnect unverified.
OnPlayerReset
OnPlayerReset(callback: (event: { player: CSPlayerPawn }) => void): voidCalled when a player respawns, changes team, or is placed back at spawn due to a round restart
Same moment as game event player_spawn unverified. Also fires on a team change and on a round-restart respawn.
OnBotControl
OnBotControl(callback: (event: { controller: CSPlayerController }) => void): voidCalled when a player takes or releases control of a bot.
OnPlayerTeamChanged
OnPlayerTeamChanged(callback: (event: { player: CSPlayerPawn, oldTeam: number }) => void): voidCalled when a player changes team
Same moment as game event player_team unverified.
OnRoundStart
OnRoundStart(callback: () => void): voidCalled when a new round begins
Same moment as game event round_start unverified.
OnRoundEnd
OnRoundEnd(callback: (event: { winningTeam: number, reason: CSRoundEndReason }) => void): voidCalled when a team wins a round
Same moment as game event round_end unverified.
OnBeginRoundRestart
OnBeginRoundRestart(callback: () => void): voidCalled at the start of cleanup for a round restart
Same moment as game event cs_pre_restart unverified.
OnBombPlantStart
OnBombPlantStart(callback: (event: { planter: CSPlayerPawn }) => void): voidCalled when a player starts planting their c4
Same moment as game event bomb_beginplant unverified.
OnBombPlantAbort
OnBombPlantAbort(callback: (event: { planter: CSPlayerPawn }) => void): voidCalled when a player aborts planting their c4
Same moment as game event bomb_abortplant unverified.
OnBombPlant
OnBombPlant(callback: (event: BombPlantEvent) => void): voidCalled when a player plants their c4
Same moment as game event bomb_planted unverified.
OnBombDefuseStart
OnBombDefuseStart(callback: (event: { plantedC4: CSPlantedC4 }) => void): voidCalled when a player starts defusing a c4
Same moment as game event bomb_begindefuse unverified.
OnBombDefuseAbort
OnBombDefuseAbort(callback: (event: { plantedC4: CSPlantedC4 }) => void): voidCalled when a player aborts defusing a c4
Same moment as game event bomb_abortdefuse unverified.
OnBombDefuse
OnBombDefuse(callback: (event: BombDefuseEvent) => void): voidCalled when a player defuses a c4
Same moment as game event bomb_defused unverified.
OnBombExplode
OnBombExplode(callback: (event: { plantedC4: CSPlantedC4 }) => void): voidCalled when a c4 explodes
Same moment as game event bomb_exploded unverified.
OnHostagePickUpStart
OnHostagePickUpStart(callback: (event: { hostage: CSHostage }) => void): voidCalled when a player starts picking up a hostage
OnHostagePickUpAbort
OnHostagePickUpAbort(callback: (event: { hostage: CSHostage, player: CSPlayerPawn }) => void): voidCalled when a player aborts picking up a hostage
OnHostagePickUp
OnHostagePickUp(callback: (event: { hostage: CSHostage }) => void): voidCalled when a player finishes picking up a hostage
Same moment as game event hostage_follows unverified.
OnHostageDrop
OnHostageDrop(callback: (event: { hostage: CSHostage, dropper: CSPlayerPawn }) => void): voidCalled when a carried hostage is dropped without being rescued
Same moment as game event hostage_stops_following unverified.
OnHostageRescue
OnHostageRescue(callback: (event: { hostage: CSHostage }) => void): voidCalled when a hostage reaches a rescue zone
Same moment as game event hostage_rescued unverified.
OnHostageKill
OnHostageKill(callback: (event: { hostage: CSHostage, attacker?: CSPlayerPawn }) => void): voidCalled when a hostage is killed
Same moment as game event hostage_killed unverified.
OnModifyPlayerDamage
OnModifyPlayerDamage(callback: (event: ModifyPlayerDamageEvent) => ModfiyPlayerDamageResult | void): voidCalled immediately before a CSPlayerPawn takes damage to armor and health.
Called after hitgroup modifications are applied such as headshot multiplier.
This won't be called if the player would take no damage. Such as if they're frozen or invulnerable or if friendly fire would disable the damage.
callback: Return{ damage: N }to modify the amount of damage.
Return{ damageFlags: event.damageFlags | CSDamageFlags.IGNORE_ARMOR }to have the damage pierce armor.
Return{ abort: true }to cancel the damage event.
Runs before damage is applied, so no event exists yet; player_hurt follows it.
OnPlayerDamage
OnPlayerDamage(callback: (event: PlayerDamageEvent) => void): voidCalled when a player has taken damage.
Same moment as game event player_hurt unverified.
OnPlayerKill
OnPlayerKill(callback: (event: { player: CSPlayerPawn, inflictor?: Entity, attacker?: Entity, weapon?: CSWeaponBase }) => void): voidCalled when a player dies. inflictor, attacker and weapon will match the damage event that caused the kill.
Same moment as game event player_death unverified.
OnPlayerJump
OnPlayerJump(callback: (event: { player: CSPlayerPawn }) => void): voidCalled when a player jumps off the ground.
Same moment as game event player_jump unverified.
OnPlayerLand
OnPlayerLand(callback: (event: { player: CSPlayerPawn }) => void): voidCalled when a player hits the ground while falling.
OnPlayerChat
OnPlayerChat(callback: (event: { player?: CSPlayerController, text: string, team: number }) => void): voidCalled when a player sends a chat message. team will match they player's team if the message was sent to team chat.
Same moment as game event player_chat unverified.
OnPlayerPing
OnPlayerPing(callback: (event: { player: CSPlayerController, position: Vector }) => void): voidCalled when a player pings a location.
Same moment as game event player_ping unverified.
OnGunReload
OnGunReload(callback: (event: { weapon: CSWeaponBase }) => void): voidCalled when a gun is reloaded.
Same moment as game event weapon_reload unverified.
OnGunFire
OnGunFire(callback: (event: { weapon: CSWeaponBase }) => void): voidCalled when a gun emits bullets. A shotgun will only trigger this once when emitting multiple bullets at once.
Same moment as game event weapon_fire unverified.
OnBulletImpact
OnBulletImpact(callback: (event: { weapon: CSWeaponBase, position: Vector, hitEntity?: Entity }) => void): voidCalled when a bullet hits a surface.
Penetrations can cause a single bullet to trigger multiple impacts.
This will be called for all impacts of a bullet before any player damage events are called.
Same moment as game event bullet_impact unverified.
OnWeaponDrop
OnWeaponDrop(callback: (event: { weapon: CSWeaponBase, dropper: CSPlayerPawn }) => void): voidCalled when a weapon is dropped.
Same moment as game event item_remove unverified. There is no weapon_drop event; item_remove is the nearest and also fires when an item is removed for other reasons.
OnWeaponPickup
OnWeaponPickup(callback: (event: { weapon: CSWeaponBase }) => void): voidCalled when a weapon is picked up.
Same moment as game event item_pickup unverified.
OnGrenadeThrow
OnGrenadeThrow(callback: (event: { weapon: CSWeaponBase, projectile: CSGrenadeProjectileBase }) => void): voidCalled when a grenade is thrown. projectile is the newly created grenade projectile.
Same moment as game event grenade_thrown unverified.
OnGrenadeBounce
OnGrenadeBounce(callback: (event: GrenadeBounceEvent) => void): voidCalled when a grenade bounces.
Same moment as game event grenade_bounce unverified.
OnKnifeAttack
OnKnifeAttack(callback: (event: { weapon: CSWeaponBase, attackType: CSWeaponAttackType }) => void): voidCalled when a knife attacks, even if it misses.
OnCustomHudClicked
OnCustomHudClicked(callback: (event: { player: CSPlayerController, layout: CustomHudLayout, buttonId: string }) => void): voidCalled when a button in a CustomHudLayout is clicked.
GetPlayerController
GetPlayerController(playerSlot: number): CSPlayerController | undefinedGet the player controller in the given slot.
GetAllPlayerControllers
GetAllPlayerControllers(): CSPlayerController[]Get all the player controllers. Includes disconnected players.
TraceLine
TraceLine(trace: BaseTraceConfig): TraceResultTrace a point along a line and detect collisions
TraceSphere
TraceSphere(trace: { radius: number } & BaseTraceConfig): TraceResultTrace a sphere along a line and detect collisions
TraceBox
TraceBox(trace: { mins: Vector, maxs: Vector } & BaseTraceConfig): TraceResultTrace an axis aligned bounding box along a line and detect collisions
TracePlayer
TracePlayer(trace: PlayerTrace): PlayerTraceResultTrace as a player would collide
TraceBullet
TraceBullet(trace: BulletTrace): BulletTraceResult[]Trace as a bullet and detect hits and damage
IsDedicatedServer
IsDedicatedServer(): booleanGet if the server is a dedicated server.
GetGameTime
GetGameTime(): numberGet the game time in seconds.
GetGameType
GetGameType(): numberGet the current Game Type.
See also: Game modes.
GetGameMode
GetGameMode(): numberGet the current Game Mode.
See also: Game modes.
GetMapName
GetMapName(): stringGet the name of the current map.
SpawnGrenadeProjectile
SpawnGrenadeProjectile(config: SpawnGrenadeProjectileConfig): CSGrenadeProjectileBaseSpawns a live grenade projectile.
Precache experimental
Precache(config: { resources?: string[], entities?: string[] }): CSPrecache | undefinedLoads resources on the server and clients to avoid hitches when later referenced.resources supports .vmdl, .vpcf, .vmat, and .vsnd resources.entities takes entity class names or subclass names.
Experimental: This feature is experimental and may experience breaking changes. Please send feedback to CSGOTeamFeedback@valvesoftware.com with "cs_script Feedback" in the subject line.
OnBeforePlayerDamage deprecated
OnBeforePlayerDamage(callback: () => any): voidDeprecated: This method will be removed in a future update
OnBeforeReload deprecated
OnBeforeReload(callback: () => any): voidDeprecated: This method will be removed in a future update
OnReload deprecated
OnReload(callback: (memory: any) => void): voidDeprecated: This method will be removed in a future update
EntFireAtName deprecated
EntFireAtName(config: { name: string, input: string, value?: InputValue, caller?: Entity, activator?: Entity, delay?: number }): voidDeprecated: This method will be removed in a future update
EntFireAtName(name: string, input: string, inputData?: InputValue | { value?: InputValue, caller?: Entity, activator?: Entity }, delay?: number): voidDeprecated: This method will be removed in a future update
See also: Entity I/O.
EntFireAtTarget deprecated
EntFireAtTarget(config: { target: Entity, input: string, value?: InputValue, caller?: Entity, activator?: Entity, delay?: number }): voidDeprecated: This method will be removed in a future update
EntFireAtTarget(target: Entity, input: string, inputData?: InputValue | { value?: InputValue, caller?: Entity, activator?: Entity }, delay?: number): voidDeprecated: This method will be removed in a future update
See also: Entity I/O.
Msg deprecated
Msg(text: any): voidDeprecated: This method will be removed in a future update
ClientCommand deprecated
ClientCommand(playerSlot: number, command: string): voidDeprecated: This method will be removed in a future update
See also: Commands.
ServerCommand deprecated
ServerCommand(command: string): voidDeprecated: This method will be removed in a future update
RegisterCheatCommand deprecated
RegisterCheatCommand(name: string, callback: (args: string) => void): voidDeprecated: This method will be removed in a future update
IsWarmupPeriod deprecated
IsWarmupPeriod(): booleanDeprecated: This method will be removed in a future update
IsFreezePeriod deprecated
IsFreezePeriod(): booleanDeprecated: This method will be removed in a future update
IsTeamIntroPeriod deprecated
IsTeamIntroPeriod(): booleanDeprecated: This method will be removed in a future update
GetRoundsPlayed deprecated
GetRoundsPlayed(): numberDeprecated: This method will be removed in a future update
GetRoundRemainingTime deprecated
GetRoundRemainingTime(): numberDeprecated: This method will be removed in a future update
SetRoundRemainingTime deprecated
SetRoundRemainingTime(time: number): voidDeprecated: This method will be removed in a future update
AddTeamMoney deprecated
AddTeamMoney(team: number, reason: CSTeamMoneyReason, amount?: number): voidDeprecated: This method will be removed in a future update
FindEntityByName deprecated
FindEntityByName(name: string): Entity | undefinedDeprecated: This method will be removed in a future update
FindEntitiesByName deprecated
FindEntitiesByName(name: string): Entity[]Deprecated: This method will be removed in a future update
FindEntityByClass deprecated
FindEntityByClass(className: string): Entity | undefinedDeprecated: This method will be removed in a future update
See also: Entity I/O.
FindEntitiesByClass deprecated
FindEntitiesByClass(className: string): Entity[]Deprecated: This method will be removed in a future update
See also: Entity I/O.
ConnectOutput deprecated
ConnectOutput(target: Entity, output: string, callback: (inputData: { value?: InputValue, caller?: Entity, activator?: Entity }) => any): number | undefinedDeprecated: This method will be removed in a future update
See also: Entity I/O.
DisconnectOutput deprecated
DisconnectOutput(connectionId: number): voidDeprecated: This method will be removed in a future update