--// Configuration Variables
local KeySettings = {
Title = "Rodan Hub",
Subtitle = "Key System",
Note = "Get Key By Joining Discord or Clicking Link",
FileName = "RodanHubKey_" .. game.Players.LocalPlayer.Name,
KeyURL = "https://[Log in to view URL]", -- Replace with Linkvertise/Discord or a site with keys
ExpireDays = 3, -- Number of days before the key expires
VerificationLink = "https://[Log in to view URL]", -- Verification link
KeyURL = ""
}
--// Function to Save Key Locally
local function saveKey(key)
if writefile then
writefile(KeySettings.FileName, key .. "|" .. os.time())
end
end
--// Function to Load Key from Local Storage
local function loadKey()
if isfile and isfile(KeySettings.FileName) then
local keyData = readfile(KeySettings.FileName)
local key, timestamp = unpack(string.split(keyData, "|"))
if os.time() - tonumber(timestamp) < KeySettings.ExpireDays * 86400 then
return key -- Return the key if it's still valid
end
end
return nil -- Return nil if the key is not valid
end
--// Function to Prompt User for Key
local function promptForKey()
local key = nil
while not key do
key = game:GetService("Players").LocalPlayer:PromptInput("Enter your key to access Rodan Hub:", "Enter Key")
if key and verifyKey(key) then
saveKey(key)
return key
else
game:GetService("Players").LocalPlayer:PromptInput("Invalid or expired key. Please verify at:\n\n" .. KeySettings.VerificationLink, "Copy Link", KeySettings.VerificationLink)
end
end
return nil
end
--// Function to Verify the Key with Local or Online Check
local function verifyKey(key)
-- Check if the key is valid locally (if you want local verification)
if isfile and isfile(KeySettings.FileName) then
local savedKey, timestamp = unpack(string.split(readfile(KeySettings.FileName), "|"))
if key == savedKey then
return true -- Key matches the saved one
end
end
-- If no local key or mismatch, make an HTTP request to verify key remotely
local success, response = pcall(function()
return game:HttpPost("https://[Log in to view URL]", game:GetService("HttpService"):JSONEncode({ key = key }), Enum.HttpContentType.ApplicationJson)
end)
if success then
local responseData = game:GetService("HttpService"):JSONDecode(response)
return responseData.success -- Return true if the server confirms the key is valid
else
warn("Failed to verify key online.")
end
return false
end
--// Main Key System
local function main()
local key = loadKey()
if not key then
-- Prompt the user to enter their key
key = promptForKey()
end
if key then
print("Access Granted! Key: " .. key)
-- Load your main game hub here
-- Example: RodanHub:Load()
else
error("Failed to obtain a valid key.")
end
end
--// Run the Key System
main()
To embed this project on your website, copy the following code and paste it into your website's HTML: