Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/25/17, 03:20 PM   #1
Rahon
Join Date: Apr 2017
Posts: 3
function expected instead of nil

Hello,

i run into following issue:


Code:
user:/AddOns/FooAddon/FooAddon.lua:5: function expected instead of nil stack traceback: user:/AddOns/FooAddon/FooAddon.lua:5: in function '(main chunk)'

when im trying to run this code:


Code:
ADDON_NAME = "Test" EVENT_MANAGER: RegisterForEvent(ADDON_NAME,EVENT_MOUNTED_STATE_CHANGED, IsOnMount()) -- d(IsMounted("player")) -- d(onMount) local function IsOnMount(event, onMount) if onMount == IsMounted("player") then d("Mounting") else d("Unmounting") end

I'm guessing that it has something to do with "IsOnMount()" not receiving and/or the EVENT_MANAGER not giving away its variables - in this case the EventID and the Boolean value.

This is my first experience in coding in lua, so im glad for any help I can get.

cheers
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » function expected instead of nil


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off