FreeER Grandmaster Cheater Supreme Reputation: 42 Joined: 09 Aug 2013 Posts: 1089
|
Posted: Mon Jun 26, 2017 5:23 pm Post subject: |
|
|
yeah, it should be 168 
Code: | attempt to perform arithmetic on a nil value (local 'addr') | means that addr had the value nil (basically undefined or not set) but was used in some kind of math (in this case addition). Since the code tries to set it to tonumber(f.Address[i]) that means that tonumber returned nil instead of a valid number, which means that what it got wasn't a valid number.... ah, I forgot that the string is going to be in hex like "4003BC" and that tonumber assumes it'll be base 10 by default where a letter would mean it's not a valid number.
simple example code
Code: | print(tonumber("A")) -- nil (not a base 10 number)
print(tonumber("A",16)) -- 10, 9+1 in base 16 is 0xA, decimal 10
print(tonumber("G",16)) -- nil, not a valid digit in hex, only 0-F
|
So it should be as simple as using Code: | local addr = tonumber(f.Address[i],16) | 
Sorry 'bout that... it does tend to be the simple things that you forget
|
|