bit.bor

From Garry's Mod
Jump to: navigation, search
 bit.bor( )

Contents

Description

Returns the bitwise OR of all values specified.

Arguments

number value1

The first value.

Arguments

vararg ...

Extra values to be evaluated. (must all be numbers)

Returns

number

The bitwise OR result between all numbers.

Examples

Example

Performs the bitwise OR operation between three values

local a = math.BinToInt("1000")
local b = math.BinToInt("0100")
local c = math.BinToInt("0001")

local result = bit.bor(a, b, c)

print(math.IntToBin(result))
print(result)

Output:

1101
13

Examples

Example

Adding multiple capabilities to an NPC.

NPC:CapabilitiesAdd( bit.bor( CAP_MOVE_GROUND, CAP_ANIMATEDFACE, CAP_TURN_HEAD ) )


Personal tools
Navigation