Unique ID System

Unique ID System

Also known as the Serial Number System .
A lightweight and improved way to generate unique serial IDs.
This is a very basic system, so please don’t expect anything advanced..

Features

  • Optional Auto-save
  • Optional force
  • Optional cooldown

How to Use

Configure the system before using it:

return {
    --// Cooldown Configuration
    COOLDOWN = {
        COOLDOWN_DURATION = 2,
    },

    --// Unique ID Configuration
    UNIQUE_ID = {
        DATA_NAME = "SerialNumberData", -- DataStore name for storing unique IDs
        EXPIRATION_TIME = 3888000,      -- 45 days in seconds

        AUTO_SAVE = {
            ENABLED = true,             -- Enable/disable auto-saving
            INTERVAL = 300,             -- Auto-save every 5 minutes
            LIST = {                    -- Keys to auto-save
                "Test1",
                "Test2"
            }
        },

        FORCE_RETRIES = {
            ENABLED = true,             -- Retry on failure
            MAX_FORCE_RETRIES = 3,      -- Max retry attempts
        }
    }
}

Usage Example

local Unique = require(script.Parent.Module.Unique)
Unique(Test_Key)
local CooldownModule = require(script.Parent.Module.Core.Cooldown)

--// Dont use this , its just for testing purposes
local function Testing(player: Player)
    if player.Name == "6rfxn" then
        local Test_Key = "Test1"
        while true do
            if CooldownModule:Cooldown(player) then 
                print(Unique(Test_Key))
            end
            task.wait(1)
        end 
    end
end
game.Players.PlayerAdded:Connect(Testing)

Expected Output

  17:44:19.285  2  -  Server - Test:10
  17:44:20.286  Cooldown bro  -  Server - Cooldown:11
  17:44:21.755  3  -  Server - Test:10
  17:44:22.767  Cooldown bro  -  Server - Cooldown:11
  17:44:24.247  4  -  Server - Test:10
  17:44:25.252  Cooldown bro  -  Server - Cooldown:11
  17:44:26.722  5  -  Server - Test:10

Click Me To Install

7 Likes

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

1 Like

Updated : 29/11/24 ( Gmt 8+ Sg )

1 Like