Posted 05 July 2015 - 11:06 PM
Hello. I've been trying to add a custom function to the string API, to be able to call myString:foo(). I did:
But it returns attempt to call nil. The strange thing is that I tried it in Lua for Windows, and it worked. Is it a LuaJ bug? If yes, how can I do it in CC? Because the String API works…
Thanks!
str = "Hello"
function string.foo(str, add)
return str.." "..add
end
str:foo("world")
But it returns attempt to call nil. The strange thing is that I tried it in Lua for Windows, and it worked. Is it a LuaJ bug? If yes, how can I do it in CC? Because the String API works…
Thanks!