mrboosch Posted April 26, 2017 Share Posted April 26, 2017 (edited) Hey all, I am attempting to overwrite the default ACTIONS.PICKUP action in my mod safely. When I try to do this, the action fires twice every time it fires (so all things can still pick things up, but at the same time they get "I cant do that" and the print in my fn below fires twice). My Code (in modmain.lua, tak is my mod's character): local function _overrideActionPickupFn(inst) if ACTIONS and ACTIONS.PICKUP and ACTIONS.PICKUP.fn ~= newPICKUPfn then local _actionPickupFn = ACTIONS.PICKUP.fn local function newPICKUPfn(act) _actionPickupFn(act) print("[TAKDEBUG] NewActionWorking!") end ACTIONS.PICKUP.fn = newPICKUPfn end end AddPrefabPostInit("tak", _overrideActionPickupFn) Any thoughts here? I am sure it's something silly, but I cant figure it out! Edited April 30, 2017 by mrboosch Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now