Serial Number and Cooldown ( Open Source )

Hello, everyone! I want to share my simple open-source serial number generator along with a cooldown module. This is very easy to use, and the serial number is saved for only 45 days because I’m using MemoryStoreService. The reason I’m using MemoryStoreService is that MemoryStoreService is a high-throughput and low-latency data service that provides fast in-memory data storage accessible from all servers in a live session.

Preview :

SerialNumber

Cooldown


How to use it ?

	if CooldownModule(player, 3) then 
		local serialNumber = SerialNumberModule:Generate(player, "Hello")  --// "String" Could be anything  // Return as number
	end

Or even

	if CooldownModule(player) then  --// Default cooldown is 2
		local serialNumber = SerialNumberModule:Generate(player, "Watasigma")  --// "String"  , Could be anything // Return as number
	end

Example :

local ServerScriptService = game:GetService("ServerScriptService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

--[[ Module ]]
local SerialNumberModule = require(ServerScriptService.Module.SerialNumberModule)
local CooldownModule = require(ServerScriptService.Module.CooldownModule)

function Test(player)
	-- Ensure cooldown data is initialized for the player
	CooldownModule(player) -- Call this to initialize if needed

	task.wait(5) -- waiting hehe

	if CooldownModule(player, 3) then
		local serialNumber = SerialNumberModule:Generate(player, "Hello")
	end
end

game.Players.PlayerAdded:Connect(function(player)
	Test(player)
end)

-- If running in Studio
if RunService:IsStudio() then
	for _, player in ipairs(game.Players:GetPlayers()) do
		Test(player)
	end
end

Output :
First Join
image
2nd Join
image

Note: Please be aware that you need to create your own data store in order to save the serial numbers!

OpenSource.rbxl (56.4 KB)

4 Likes

This is sick bro great job! Will definitely be using this

1 Like