Posted 22 October 2015 - 03:51 AM
Im writting a rights system, where each registered player is given a number, where each bit corresponds with access to something, lets say a door for example. (Its vauge because im making it so i can be applied to anything.) I have written this system before but not in lua.
I am having problem with the removeRight method. What it is supposed to do, is set the specified bit of a number to zero, everytime.
my original though was to do
bit32.band(playerRight, bit32.bnot(bitLocation))
but its not working as I want.
eg
1011, removeRight at index 0 yeilds = 1010
I would love to hear all help, and if you have any questions let me know, I am happy to elaborate if I wasn't clear enough
I am having problem with the removeRight method. What it is supposed to do, is set the specified bit of a number to zero, everytime.
my original though was to do
bit32.band(playerRight, bit32.bnot(bitLocation))
but its not working as I want.
eg
1011, removeRight at index 0 yeilds = 1010
I would love to hear all help, and if you have any questions let me know, I am happy to elaborate if I wasn't clear enough