标签: eluna-lua-engine

worldobject:RegisterEvent error on indexing worldobject

When I attempt to use the examples shown on site for making a worldobject registerevent I get an error on the worldobject, implying it is a nil value like so:

lua_scripts/test.lua:5: attempt to index global 'worldobject' (a nil value)

Tried a few different examples with the same outcome, so naturally I expect its probably some oversight on my part.

Tested examples:

local function YourFunction(eventid, delay, repeats, worldobject)
      worldobject:SendUnitSay("My name is " .. worldobject:GetName(), 255)
end
worldobject:RegisterEvent(YourFunction, 10000, 5)
Run Code Online (Sandbox Code Playgroud)
local function …
Run Code Online (Sandbox Code Playgroud)

lua azerothcore eluna-lua-engine

3
推荐指数
1
解决办法
44
查看次数

标签 统计

azerothcore ×1

eluna-lua-engine ×1

lua ×1