ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. bitXor

Function

bitXor

Server and clientBitwise operationsIdentical to MTA:SA

Bitwise XOR of two or more numbers. Useful for toggling flags.

Syntax

int bitXor(int a, int b)

Arguments

aint
First number.
bint
Second number (more can be given).

Returns

The result.

Example

local flags = 5
flags = bitXor(flags, 4)  -- wyłącza bit 4 / clears bit 4
print(flags)              -- 1