GSC reference › Built-in

Assert()

Built-in (engine) Server + client Utility

Assert that the given statement is correct. The function will throw a script error if this is false.

Signature

Assert(<value>, [desc])

Parameters

NameRequired?Details
valueRequired statement that is asserted to be correct
descOptional string describing the nature of the assert

Example (from Treyarch's docs)

Assert( enemyInSight == true )

Real uses in BO3's scripts

Called 2,099 times in the decompiled scripts. A few, zombies first:

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).