Modding Help Help with NPC manipulation with LUA

Discussion in 'Starbound Modding' started by Nitofex, Apr 27, 2020.

  1. Nitofex

    Nitofex Big Damn Hero

    Hi, so I'm attempting to do several different things regarding NPC's, one of which I can't wrap my head around.

    If I use the "npc.say()" function, or any "npc.XX" function in my own script file, what the .log file gives back is this:

    Exception while invoking lua function 'applyDamageRequest'. (LuaException) Error code 2, [string "/stats/ModBase/npc.lua"]:63: attempt to index a nil value (global 'npc')
    stack traceback:
    [C]: in metamethod '__index'

    Now, I either don't know how to use "npc.XX" functions, or they are not global as I though, or I'm missing something else completely, any help would be appreciated.
     
    Last edited: Apr 27, 2020

Share This Page