Bosoca Posted July 26, 2021 Share Posted July 26, 2021 I have created a component that allows me to poison a target temporarily, the function for poisoning the target is on the component. So that whenever I give this component to a weapon, I'm able to tip it with poison. However when I reload my game, it doesn't save the component. This is the code I have located at the bottom of the code, I have it to set self.mod_data to nil on default but I'm unsure of what I'm supposed to do after that, I tried to set the mod_data variable to the prefab of the weapon it's set on function poison_trait:OnSave() return self.mod_data end function poison_trait:OnLoad(data) if data and data.mod_data ~= nil then self.mod_data = data.mod_data end end 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