Skip to main content
Bloxstrike only. Guard with if api.client.x then before calling on other games.

Getters

CallReturnsWhat it tells you
getWeapon()LoadoutEntry?What you’re currently holding. nil if empty-handed.
getWeaponName()string?Name of your current weapon, e.g. "AK-47".
getWeaponProperties()any?Detailed weapon stats (damage, fire rate, range, etc.).
getInventory(){ LoadoutEntry }Everything in your inventory.
getMoney()numberYour current money. 0 if unknown.
getAmmo()AmmoState?Ammo for what you’re holding: { rounds, reserve }. nil when empty-handed or the item has no ammo. See AmmoState.
isBlind() / isFlashed()booleantrue while a flashbang is whiting out your screen.
getFlashVisibility()numberHow much you can see while flashed. 0 = fully white, 1 = no flash.
isScoped()booleantrue while zoomed in with a scoped weapon.
isDefusing()booleantrue while you’re actively defusing the bomb.
isClimbing()booleantrue while climbing a ladder.
hasC4()booleantrue if you’re carrying the bomb.
isRescuingHostage()booleantrue while channeling a hostage rescue.
isCarryingHostage()booleantrue while carrying a rescued hostage.
getArmor()ArmorStateArmor type and durability. See ArmorState.
hasArmor()booleantrue if you have kevlar.
hasHelmet()booleantrue if you have a helmet (implies kevlar).
getSpectatorCount()numberHow many players are spectating you.
isBeingSpectated()booleantrue if at least one player is spectating you.

Signals

Call :Connect(callback) on these. They get cleaned up when your script unloads.
SignalYour callback receives
onWeaponChanged(weapon): nil if you go empty-handed
onSpectatingChanged(spectating)
onBlindChanged(blind): flashbang start / end
onFlashVisibilityChanged(visibility): every frame while flashed, as vision recovers
onScopedChanged(scoped)
onDefusingChanged(defusing)
onC4Changed(hasC4)
onRescuingChanged(rescuing): started or stopped rescuing a hostage
onCarryingChanged(carrying): picked up or dropped a hostage
onArmorChanged(armor): bought armor, took damage, or reset
onSpectatorCountChanged(count)
onMoneyChanged(money)

Example

api.client.onWeaponChanged:Connect(function(weapon)
    print("equipped:", weapon and weapon.Name or "nothing")
end)

-- Watch your economy
api.client.onMoneyChanged:Connect(function(money)
    local ammo = api.client.getAmmo()
    print("money:", money, "ammo:", ammo and ammo.rounds or "-")
end)