Aside from my copy/paste capitalizing the "o" in line 8 (wtf?), it compiled fine.
Adding this to a test file with your code:
Adding this to a test file with your code:
function readUTF(a_str) local len, str = string.byte(a_str,1) * 256 + string.byte(a_str,2), a_str:sub(3) return str:sub(1,len), str:sub(len+1) end local obj = PluginMsg:new("Bungeecord"):WriteUTF("Test"):WriteUTF("Hi") local channel, msg = obj:Get() local o1, rem1 = readUTF(msg) local o2, _ = readUTF(rem1) print(o1 .. " " .. o2)I got the error "{file location stuff}\testchaining.lua:31: attempt to call method 'WriteUTF' (a nil value)" where 31 is the line where I defined obj. I then tried splitting it up
local obj = PluginMsg:new("Bungeecord") local obj2 = obj:WriteUTF("Test") local obj3 = obj2:WriteUTF("Hi")but it errored out (same error) on the first line with WriteUTF. I'm assuming this means that somethings going wrong in the metatable line, but I've no idea how to fix it.