"cRoot" by itself is a class name, not an actual object. You wouldn't expect to write "cPlayer" and the server to magically know which one player you mean
This class has a (static) method "Get()" that returns the one instance of the object that the server is using. So if you want a cRoot object, you need to call "cRoot:Get()"
Finally, on this object you call its (non-static) method "GetWorld()".
I know, it is needlessly complicated, we could have made the GetWorld() function static as well (same with most of the cRoot functions, they would just operate on the single cRoot instance ever created in the server). Historical reasons.
What is even more unfortunate is the error message produced by ToLua. It is very confusing, and whoever wrote it should be ashamed of themselves. Unfortunately it's part of ToLua and as such is quite difficult to change to anything more reasonable.
One thing you might want to remember from this: When you write "Object:Function(Param)" in Lua, it actually means "Object.Function(Object, Param)" (the Object is passed as a hidden first parameter to the function), that's why ToLua is complaining about the first parameter - it is not the world's name, it's the cRoot.
A final thought, you may want to write your code in English, you never know when you're gonna opensource it or when you need help from outside
--
I edited the title of your post to be more descriptive of the thread contents.
This class has a (static) method "Get()" that returns the one instance of the object that the server is using. So if you want a cRoot object, you need to call "cRoot:Get()"
Finally, on this object you call its (non-static) method "GetWorld()".
I know, it is needlessly complicated, we could have made the GetWorld() function static as well (same with most of the cRoot functions, they would just operate on the single cRoot instance ever created in the server). Historical reasons.
What is even more unfortunate is the error message produced by ToLua. It is very confusing, and whoever wrote it should be ashamed of themselves. Unfortunately it's part of ToLua and as such is quite difficult to change to anything more reasonable.
One thing you might want to remember from this: When you write "Object:Function(Param)" in Lua, it actually means "Object.Function(Object, Param)" (the Object is passed as a hidden first parameter to the function), that's why ToLua is complaining about the first parameter - it is not the world's name, it's the cRoot.
A final thought, you may want to write your code in English, you never know when you're gonna opensource it or when you need help from outside
--
I edited the title of your post to be more descriptive of the thread contents.