Cmdpro Posted January 17, 2022 Share Posted January 17, 2022 I have been trying to get this working for a while but to nothing, i want it so when i right click my custom item it runs a function but, when i right click my custom item the character stops moving for a second like it wants to examine then i can move again however the logs does not contain true or false, if anyone knows what i am doing wrong please help me -- wont run local INVUSE = AddAction("INVUSE", "Use", function(act) print(act.invobject.components.useableitemininventory:CanInteract()) if act.invobject.components.useableitemininventory:CanInteract() == true then act.invobject.components.useableitemininventory:StartUsingItem() end return true end) AddComponentAction("INVENTORY", "useableitemininventory", function(inst, doer, actions, right) --code found in edible.lua but changed the table.insert to work with INVUSE if (right or inst.replica.equippable == nil) and not (doer.replica.inventory:GetActiveItem() == inst and doer.replica.rider ~= nil and doer.replica.rider:IsRiding()) then table.insert(actions, INVUSE) end end) Link to comment https://forums.kleientertainment.com/forums/topic/136941-trying-to-make-a-right-click-on-item-in-inventory-action/ Share on other sites More sharing options...
Monti18 Posted January 17, 2022 Share Posted January 17, 2022 You're still missing the actionhandler: AddStategraphActionHandler("wilson", ActionHandler(INVUSE, "doshortaction")) AddStategraphActionHandler("wilson_client", ActionHandler(INVUSE, "doshortaction")) 1 Link to comment https://forums.kleientertainment.com/forums/topic/136941-trying-to-make-a-right-click-on-item-in-inventory-action/#findComment-1533279 Share on other sites More sharing options...
Cmdpro Posted January 17, 2022 Author Share Posted January 17, 2022 3 hours ago, Monti18 said: You're still missing the actionhandler: AddStategraphActionHandler("wilson", ActionHandler(INVUSE, "doshortaction")) AddStategraphActionHandler("wilson_client", ActionHandler(INVUSE, "doshortaction")) Thanks while this is not what i needed (i managed to figure it out RIGHT after reading this and i just needed INVUSE.instant = true) it may help next time i want to make a custom action 1 Link to comment https://forums.kleientertainment.com/forums/topic/136941-trying-to-make-a-right-click-on-item-in-inventory-action/#findComment-1533320 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now