Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>CS2 VScript NativesNew to Visual Studio Code? Get it now.
CS2 VScript Natives

CS2 VScript Natives

poggudev

|
893 installs
| (1) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CS2 VScript Natives

This extension adds definitions for the VScript natives used in CS2 to the Lua extension.

Screenshot Screenshot

Casting from HScript

Because the extension doesn't know the type of a HScript instance (It can represent multiple types, CBaseEntity, CBasePlayerPawn, CBasePlayerController, etc..), it will always represent handle/any. This means that you will have to cast it to the correct type yourself.

---@type CBasePlayerController
local pawn = EntIndexToHScript(entIndex);
pawn:GetPawn();

Alternatively, you can make a wrapper function that will cast it to the correct type for you.

---@return CBasePlayerPawn
function EntIndexToPawn(entIndex)
    return EntIndexToHScript(entIndex)
end

---@return CBasePlayerController
function EntIndexToController(entIndex)
    return EntIndexToHScript(entIndex)
end

---@return CBaseEntity
function EntIndexToEntity(entIndex)
    return EntIndexToHScript(entIndex)
end
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft