12.11.2020, 07:18
For numbers up to 4 bytes you can use this function:
Code:
function getbyte(value, byte)
return bit.band(bit.rshift(value, byte * 8), 0xFF)
end
value = 46124
b0 = getbyte(value, 0) -- 44
b1 = getbyte(value, 1) -- 180
b2 = getbyte(value, 2) -- 0