GetWorld parameter mismatch
#1
hi,

i try to learn lua and write plugins

now i have the first question:

i use this function:
function OnPlayerRightClick(Player)
	local Welt = cRoot:GetWorld("world")
	Player:SendMessage(Welt:GetName())
end

And get this error:
Code:
Warn [10:15:58] LUA: Plugins/test2/main.lua:46: error in function 'GetWorld'.
argument #1 is 'class cRoot'; 'cRoot' expected.

Warn [10:15:58] Stack trace:
Warn [10:15:58]   [C](-1): GetWorld
Warn [10:15:58]   Plugins/test2/main.lua(46): (no name)
Warn [10:15:58] Stack trace end
Warn [10:15:58] Error in plugin test2 calling function <callback>()

but i have no idea why?

The API-doc says:
Quote:Returns the cWorld object of the given world. It returns nil if there is no world with the given name.
Did the "WorldName" mean not a string? Or whats wrong with me?Big Grin
Can anyone help me? Smile
Reply
Thanks given by:


Messages In This Thread
GetWorld parameter mismatch - by heroldini - 10-26-2015, 07:41 PM
RE: heroldinis beginner questions^^ - by xoft - 10-26-2015, 09:18 PM
RE: GetWorld parameter mismatch - by worktycho - 10-27-2015, 01:28 AM
RE: GetWorld parameter mismatch - by DrMasik - 10-27-2015, 08:06 AM
RE: GetWorld parameter mismatch - by xoft - 10-27-2015, 08:04 PM



Users browsing this thread: 1 Guest(s)