ProfileManager - Making Data Saving Possible for Beginners
ProfileManager simplifies ProfileService further with self-explanatory functions, making data saving easier than ever.
Disclaimer: This is all possible thanks to @loleris ProfileService. I am not claiming I did all this work, its thanks to his constant support of the module that any of this is possible, I am simply making functions to save you time and make it easy to beginners that want to save data.
- Free!
- Easy!
- Beginner-friendly!
- Open-source!
DataManager download:
Download the module!
Its on github too!
Github repo
Here is a quick example, utilizing all of the functions in ProfileManager:
– NOTE: The way I use these functions is not necessarily ideal,
– they are just examples of how you could use them
-- NOTE: The way I use these functions is not necessarily ideal,
-- they are just examples of how you could use them
local ProfileManager = require(game.ServerScriptService.ProfileManager)
game.Players.PlayerAdded:Connect(function(plr)
local plrProfile = ProfileManager:LoadPlayerProfile(plr)
local plrData = ProfileManager:GetDataFromProfile(plrProfile)
print("This should print a table with atleast the default player values:")
print(plrData)
local bansProfile = ProfileManager:LoadCustomProfile("Custom", "Custom_"..game.PlaceId)
local bansData = ProfileManager:GetDataFromProfile(bansProfile)
print("This should print a table with the banned people:")
print(bansData)
bansData.bans[plr.Name] = true
ProfileManager:ReleaseProfile(bansProfile)
plr.Chatted:Connect(function(msg)
local requestedPlrId = game.Players:GetUserIdFromNameAsync(msg)
local requestedPlr = game.Players:GetPlayerByUserId(requestedPlrId)
if requestedPlr and requestedPlr:IsDescendantOf(game.Players) then
local key = "Player_"..requestedPlr.UserId
local requestedPlrProfile = ProfileManager:GetProfile(key)
local requestedPlrData = ProfileManager:GetDataFromProfile(requestedPlrProfile)
print(requestedPlrData)
ProfileManager:ReleaseProfile(requestedPlrProfile)
end
end)
end)
game:BindToClose(function()
ProfileManager:ReleaseAllProfiles()
end)
Thanks! I hope you find this module helpful. I just want to say though, this does not support more advanced things you may want to do with ProfileService, its simply just something that I wish I had when I started, to save basic, basic, data. Once again, this is just a further simplification of ProfileService.
This is my first time ever making a post like this, I hope you find it useful! Please leave anything I need to fix down in the description.
Thanks,
p1ckL