GSC reference › Built-in

ButtonBitState()

Built-in (engine) Server Player Called on: player

Return true if the button_bit(s) indicated are pressed (note: there is no way to know exactly which buttons are pressed on the client, since everything is remapped into these bit values)

Signature

<player> ButtonBitState(<button>)

Called on an entity: player ButtonBitState(...)

Parameters

NameRequired?Details
buttonRequired name of button to check "BUTTON_BIT_ATTACK" for example, optionally can include as many button names as desired. Returns true if all buttons indicated are true.

Example (from Treyarch's docs)

if ( self ButtonBitState( "BUTTON_BIT_ATTACK") ) ...

Notes

You really shouldn't be using this, unless you KNOW that you should. See buttonbits.h for button bit names.

Real uses in BO3's scripts

Not called anywhere in BO3's shipped scripts, so check it works in your mode before relying on it.

Related built-ins

New to GSC?

Start with the basics, or paste a compile error to get the fix.

Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).