Garry's Mod Wiki

bit.bor

number bit.bor( number value1, vararg ... )

Description

Returns the bitwise OR of all values specified.

Arguments

1 number value1
The first value.
2 vararg ...
Extra values to be evaluated. (must all be numbers)

Returns

1 number
The bitwise OR result between all numbers.

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

Example

Adding multiple capabilities to an NPC.

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

Page Links


Special Pages


Wikis

?

Render Time: 39ms

DB GetPage 2
Generate Html 8
SaveChanges (1) 14
Render Body 0
Render Sidebar 12