Why is my DataStore2 not working?

I am trying to make a currency system which in this case are ‘SHILLINGS’, I made my data store script, as well as an increment of 10 shillings in 60 seconds using loops, but the script is not working.

The DataStore script inside ServerScriptService

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

local DataStore2 =  require(1936396537)

local defaultShillingsAmount = 0

players.PlayerAdded:Connect(function(player)
	local shillingsStore = DataStore2("shillings", player)
	
	local function updateClientShillings(amount)
		replicatedStorage.updateClientShillings:FireClient(player, amount)
	end
	
	updateClientShillings(shillingsStore:Get(defaultShillingsAmount))
	
	shillingsStore:OnUpdate(updateClientShillings)
end)

while wait(60) do
	for k, v in pairs(players:GetChildren()) do
		local shillingsStore = DataStore2("shillings", v)
		
		shillingsStore:Increment(10)
	end
end

The Script in my Shillings Text Label,

local replicatedStorage = game:GetService("ReplicatedStorage")

replicatedStorage.updateClientShillings.OnClientEvent:Connect(function(amount)
	script.Parent.Text = "SHILLINGS: " .. amount	
end)

The issue is you are requiring the module by ID. Kampfkarren says he does not update the free model because of a Roblox bug, so you need to download the up-to-date version from the github. How to use DataStore2 - Data Store caching and data loss prevention - #826

Also, while wait() do idiom is bad practice.

5 Likes