Jump to content

Overwriting finiteuses component


samuel789
 Share

Recommended Posts

I am trying to overwrite the 'FiniteUses:OnSave()' function inside the 'finiteuses' component, as I require the game to always save an item's use count even at 100% (I'm fiddling with dynamic max uses). I think the problem might be that I'm using 'uses = component.current', but I am quite new to lua and have no other clue what to do. Any help? Thanks.

 

local function OnSave(component)
 if true then
  return { uses = component.current }
 end
end
AddComponentPostInit("finiteuses", OnSave)

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...