ked2000
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 1059 |
|
|
| 08 Jun 2014 07:07 PM |
Script: splitter = "/" decryption = 0
_G.Decrypt = function(code) local file = Instance.new("StringValue", script) decryption = decryption + 1 file.Name = "Decryption: "..decryption if type(code) == "string" then local halfNewCode = string.gsub(code, splitter, ", ") haldNewCode = tonumber(halfNewCode) if halfNewCode ~= nil or type(halfNewCode) == "number" then local newCode = string.char(halfNewCode) file.Value = tostring(newCode) print(tostring(newCode)) return tostring(newCode) end end end
msg = 102/117/110/99/116/105/111/110/58/32/50/53/53/65/49/54/54/48
_G.Decrypt(msg)
Error: bad argument #1 to 'char' (number expected, got string)
Can someone tell me why this errors? |
|
|
| Report Abuse |
|
|
Xsysix
|
  |
| Joined: 29 Mar 2014 |
| Total Posts: 1182 |
|
|
| 08 Jun 2014 07:08 PM |
haldNewCode = tonumber(halfNewCode)
You spelled half wrong
- Add 1.5k | Deplexity | its a lego men game stop worrying |
|
|
| Report Abuse |
|
|
ked2000
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 1059 |
|
|
| 08 Jun 2014 07:11 PM |
@Xsysix
Hah, it was a silly mistake. Thank you. But now it prints blank and returns blank. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 08 Jun 2014 07:19 PM |
That's not what byte code is (nor is that what Lua bytecode is, but that's beside the point). It is backward slash then the byte.
local byteCode = [[\102\117\110\99\116\105\111\110\58\32\50\53\53\65\49\54\54\48]]; local output = "";
for value in string.gmatch(byteCode, "[^\\]+") do output = output .. value:char(); end
print(output); |
|
|
| Report Abuse |
|
|