so i am making a plugin that have setting+automaticlly created stuff based on the use
i wanted to save those so the users willnot need to set up every thing again whenever they open a place
i though about saving them as json files but roblox studio doesnot allow that
i though about saving the settings as a module script in ServerStorage so it saves whenever the game is saved but i donot think this is a good idea because users can mess with it and break the plugin.
using plugin:SetSetting() and plugin:GetSetting() is a good approach. and you can use HttpService:JSONEncode() and HttpService:JSONDecode() to convert your data to and from JSON strings(the datatype that is required for plugin:GetSetting() 's value). before saving and after loading.
thank you i have looked into their documentations and they are what i need but i have 1 question
is there an event that fires when the user saves/closes the game? i think it would be better to save plugin data at that time instead of saving it when the player change a setting
I don’t think we are able to detect that yet but you can connect an event to plugin.Unloading, it runs when if the plugin is uninstalled or updated or closed