Ez DataStores(ProfileService + ReplicaService + Knit Compatable)

What is it this?

  • It’s an easy to use all in one solution made with ProfileService+ReplicaService
    ProfileService is the data store module backend(Session Locking).
    ReplicaService is for state replication to the client

Why do I want this?

  • Toss it into a project for an instantly safe datastore solution and will work for most games on the platform

  • I plan to add a lot more such as a data migration system to allow you to move your system from unorganized data stores scattered around your game to one system

  • Ez state replication. It provides you with events similar to . Changed for event-driven game development without having to worry about

Tutorial
After following my very well structured instructions all you need to know is how to interact with the module

Server

--Place in ServerScriptService

local Players = game:GetService("Players")

local PlayerDataManager = require(game:GetService("ServerScriptService").PlayerDataManager)

local Player = Players:GetPlayers()[1] or Players.PlayerAdded:Wait()

--Listening for changes
PlayerDataManager:GetPlayerDataReplica(Player):andThen(function(Replica)
	Replica:ListenToChange("Coins",function(NewValue, OldValue)
		print("Coin balance has been changed on the server: " .. tostring(NewValue))
	end)
end)

wait(6.9)
--Editing Data
PlayerDataManager:GetPlayerDataReplica(Player):andThen(function(Replica)
	--https://madstudioroblox.github.io/ReplicaService/api/#replica to find the functions of a replica and it's structure
	Replica:SetValue("Coins", Replica.Data.Coins + 10)
end)

PlayerDataManager:GetPlayerProfile(Player):andThen(function(Profile)
	--https://madstudioroblox.github.io/ProfileService/api/#profile to find the functions of a Profile and it's structure
	print(Profile)
end)

Client

--Place in StarterPlayerScripts

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local ReplicaController = require(ReplicatedStorage:WaitForChild("Replica"):WaitForChild("ReplicaController"))


ReplicaController.ReplicaOfClassCreated("PlayerData", function(Replica)
	if Replica.Tags.Player == Players.LocalPlayer then
		--This means that the replica we're currently in is the replica of our local player(Duh)

		Replica:ListenToChange("Coins",function(NewValue, OldValue)
			print("Coin balance has been changed on the client: " .. tostring(NewValue))
		end)
	end
end)

--Call once in the entire codebase read the documentation for more info https://madstudioroblox.github.io/ReplicaService/api/#replicacontrollerrequestdata
ReplicaController.RequestData()

File & Editable place

Ez PlayerDataManager.rbxm (99.4 KB)

Road Map

  • Data Migration System

  • Ordered datastores

That’s pretty much it. I don’t plan to continue this project if there isn’t any need for it so comment if you would find future updates to this module useful.

9 Likes

haha nice!

Anyways, great work!

1 Like

not sure when this is gonna get banned, funny number.

2 Likes

funy number indeed. also this is just profile service ripped off.

3 Likes

been waiting for something similar to this. very good work

2 Likes