mouse Posted March 9, 2015 Share Posted March 9, 2015 (edited) EDIT: This problem has been solved.I'm trying to add a mechanic that checks the player's sanity and prevents them from using tools when the player's sanity is below a certain point. The code below works great with mouse input but it isn't applied to keyboard(and probably controller) input for some reason: local PlayerActionPicker = require "components/playeractionpicker"local mypicker = PlayerActionPicker.GetEquippedItemActionsfunction PlayerActionPicker:GetEquippedItemActions(target, useitem, right) if self.inst:HasTag("player") and self.inst.components.sanity then if self.inst.components.sanity.current/self.inst.components.sanity.max < .66 then return nil end end return mypicker(self, target, useitem, right)endI've been monkeying with this for a couple days and I'm running out of patience. I honestly can't list everything I've tried. Would anyone have any suggestions? Edited March 10, 2015 by mouse 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