Jump to content

having trouble making a custom action


Recommended Posts

Sort of a simple issue, but I can't seem to figure out how to get this action to work:

 

local Action = GLOBAL.Action
local ACTIONS = GLOBAL.ACTIONS
local ActionHandler = GLOBAL.ActionHandler
local TUNING = GLOBAL.TUNING
local STRINGS = GLOBAL.STRINGS

local SIGN = Action({ mount_valid=true })
SIGN.str = "Sign"
SIGN.id = "SIGN"


SIGN.fn = function(act)
    if act.invobject ~= nil then
        local target = act.target or act.doer
        if act.invobject.components.signable ~= nil then
            return act.invobject.components.signable:Sign(target)
       
        else
            return 
        end
    end
end

AddAction(SIGN)

local sign_handler = ActionHandler(SIGN, "doshortaction")
AddStategraphActionHandler("wilson", sign_handler)
AddStategraphActionHandler("wilson_client", sign_handler)

This code doesn't crash, but I still can't get the action to work
these are the other files that I think are relevant:

elf_paperwork.lua
signable.lua

basically, I want the paperwork to function similarly to a blueprint, but instead of getting a recipe, the user gets a tag. Right now the paperwork is examinable but not signable

Edited by MF99K
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...