Cliffford W. Posted February 13 Share Posted February 13 For some unknown reason the code i used doesnt even work at all local function RollSave(inst) local data = { livesleft = inst.numDeaths } return next(data) ~= nil and data or nil end local function RollLoad(inst, data) print("LOADING FOR REROLL") if data.livesleft ~= nil then inst.numDeaths = data.livesleft end end --this is put in master_postinit of a character prefab inst.SaveForReroll = RollSave inst.LoadForReroll = RollLoad Link to comment Share on other sites More sharing options...
_zwb Posted February 13 Share Posted February 13 You should use inst.Save and inst.Load, unless you called inst.SaveForReroll somewhere else? Link to comment Share on other sites More sharing options...
Cliffford W. Posted February 13 Author Share Posted February 13 (edited) inst.SaveForReroll is used for when you switch characters or when seamlessplayerswapper takes place (Wonkey) Edited February 13 by Cliffford W. Link to comment Share on other sites More sharing options...
The Starver Posted February 13 Share Posted February 13 31 minutes ago, Cliffford W. said: when seamlessplayerswapper takes place (Wonkey) Wait, does this mean I could theoretically implement a mod where every 10 days your character changes randomly? Link to comment Share on other sites More sharing options...
Cliffford W. Posted February 13 Author Share Posted February 13 5 minutes ago, The Starver said: Wait, does this mean I could theoretically implement a mod where every 10 days your character changes randomly? Basically yea 1 Link to comment Share on other sites More sharing options...
Rickzzs Posted February 13 Share Posted February 13 I think it works. I do it by wrapping inst.xxx after spawning in prefabpostinit, it works for reroll. Link to comment Share on other sites More sharing options...
Cliffford W. Posted February 16 Author Share Posted February 16 Figured it out with help of DiogoW Link to comment 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