-- ROLI Hub Key System - Dynamic Edition v2.0 -- Automatically syncs key with Pastebin local plr = game.Players.LocalPlayer local uis = game:GetService("UserInputService") local tw = game:GetService("TweenService") local sg = game:GetService("StarterGui") local http = game:GetService("HttpService") -- ===== DYNAMIC KEY CONFIGURATION ===== -- Your Pastefy RAW Link local KEY_SOURCE_URL = "https://pastefy.app/S6BMpmk2/raw" -- Your Linkvertise Link (users click this to get the key) local KEY_PAGE_LINK = "https://link-hub.net/1239053/B5Fx6kisluI8" -- Ključ se automatski učitava sa Pastebin-a local CORRECT_KEY = "" -- SCRIPT TO LOAD AFTER UNLOCK local SCRIPT_TO_LOAD = "https://pastefy.app/XaU7h3Iw/raw" -- Persistent storage local KEY_STORAGE_FILE = "ROLI_KeyData.json" -- ===== COLOR SCHEME ===== local COLORS = { Primary = Color3.fromRGB(220, 20, 20), Secondary = Color3.fromRGB(180, 0, 0), Accent = Color3.fromRGB(255, 50, 50), Background = Color3.fromRGB(15, 15, 15), SecondaryBG = Color3.fromRGB(25, 25, 25), Frame = Color3.fromRGB(35, 35, 35), Text = Color3.fromRGB(255, 255, 255), TextDim = Color3.fromRGB(180, 180, 180), Success = Color3.fromRGB(50, 255, 50), Error = Color3.fromRGB(255, 50, 50), } -- ===== FETCH CURRENT KEY FROM SERVER ===== local function fetchCurrentKey() local success, result = pcall(function() local response = game:HttpGet(KEY_SOURCE_URL) return response:gsub("%s+", "") -- Remove whitespace end) if success and result and result ~= "" then return result else warn("⚠️ Failed to fetch key from server. Using fallback.") return nil end end -- Load the current key print("πŸ”„ Fetching current key from server...") CORRECT_KEY = fetchCurrentKey() if not CORRECT_KEY or CORRECT_KEY == "" then warn("❌ Could not load key from server!") return end print("βœ… Key loaded successfully: " .. CORRECT_KEY) -- ===== PERSISTENT STORAGE FUNCTIONS ===== local function saveKeyData() local success, err = pcall(function() local data = { key_verified = true, timestamp = os.time(), user_id = plr.UserId, saved_key = CORRECT_KEY -- Save the actual key for verification } writefile(KEY_STORAGE_FILE, http:JSONEncode(data)) end) return success end local function loadKeyData() local success, result = pcall(function() if isfile(KEY_STORAGE_FILE) then local data = http:JSONDecode(readfile(KEY_STORAGE_FILE)) -- Verify it's for the same user if data.key_verified and data.user_id == plr.UserId then -- Check if saved key matches current key if data.saved_key == CORRECT_KEY then return true else -- Key has changed, delete old saved data print("πŸ”„ Key has been updated! Old key expired.") clearKeyData() return false end end end return false end) return success and result end local function clearKeyData() pcall(function() if isfile(KEY_STORAGE_FILE) then delfile(KEY_STORAGE_FILE) end end) end -- ===== UTILITY FUNCTIONS ===== local function tween(obj, props, duration, style, direction) local info = TweenInfo.new( duration or 0.3, style or Enum.EasingStyle.Quad, direction or Enum.EasingDirection.Out ) tw:Create(obj, info, props):Play() end local function notify(title, text, duration) pcall(function() sg:SetCore("SendNotification", { Title = title, Text = text, Duration = duration or 3, }) end) end local function createCorner(parent, radius) local corner = Instance.new("UICorner", parent) corner.CornerRadius = UDim.new(0, radius or 10) return corner end local function createStroke(parent, color, thickness, transparency) local stroke = Instance.new("UIStroke", parent) stroke.Color = color or COLORS.Primary stroke.Thickness = thickness or 2 stroke.Transparency = transparency or 0 return stroke end local function createGlow(parent, color) local glow = Instance.new("ImageLabel", parent) glow.Size = UDim2.new(1, 30, 1, 30) glow.Position = UDim2.new(0, -15, 0, -15) glow.BackgroundTransparency = 1 glow.Image = "rbxassetid://4996891970" glow.ImageColor3 = color or COLORS.Primary glow.ImageTransparency = 0.6 glow.ZIndex = 0 return glow end -- ===== LOAD SCRIPT FUNCTION ===== local function loadMainScript() local success, err = pcall(function() loadstring(game:HttpGet(SCRIPT_TO_LOAD))() end) if success then notify("βœ… Success!", "Script loaded successfully!", 3) else notify("❌ Error!", "Failed to load script: " .. tostring(err), 5) end end -- ===== CHECK IF KEY IS ALREADY SAVED ===== if loadKeyData() then notify("πŸ”“ Already Unlocked!", "Loading script automatically...", 3) wait(1) loadMainScript() return end -- ===== GUI CREATION ===== local gui = Instance.new("ScreenGui") gui.Name = "ROLIKeySystem_" .. math.random(1000, 9999) gui.ResetOnSpawn = false gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling gui.Parent = game.CoreGui -- ===== ICON BUTTON ===== local iconBtn = Instance.new("ImageButton", gui) iconBtn.Size = UDim2.new(0, 70, 0, 70) iconBtn.Position = UDim2.new(0, 20, 0, 20) iconBtn.BackgroundColor3 = COLORS.Background iconBtn.BorderSizePixel = 0 iconBtn.AutoButtonColor = false iconBtn.Image = "rbxassetid://139409412034826" iconBtn.ScaleType = Enum.ScaleType.Fit iconBtn.Active = true iconBtn.Draggable = true createCorner(iconBtn, 16) createStroke(iconBtn, COLORS.Primary, 3) local iconGlow = createGlow(iconBtn, COLORS.Primary) spawn(function() while iconBtn and iconBtn.Parent do tween(iconGlow, {ImageTransparency = 0.3}, 0.8, Enum.EasingStyle.Sine) wait(0.8) tween(iconGlow, {ImageTransparency = 0.7}, 0.8, Enum.EasingStyle.Sine) wait(0.8) end end) -- ===== KEY SYSTEM FRAME ===== local keyFrame = Instance.new("Frame", gui) keyFrame.Size = UDim2.new(0, 420, 0, 320) keyFrame.Position = UDim2.new(0.5, -210, 0.5, -160) keyFrame.BackgroundColor3 = Color3.fromRGB(12, 12, 12) keyFrame.Visible = false keyFrame.Active = true keyFrame.Draggable = true keyFrame.BorderSizePixel = 0 keyFrame.ClipsDescendants = true keyFrame.ZIndex = 100 createCorner(keyFrame, 25) createStroke(keyFrame, COLORS.Primary, 3) createGlow(keyFrame, COLORS.Primary) -- Header local keyHeader = Instance.new("Frame", keyFrame) keyHeader.Size = UDim2.new(1, 0, 0, 80) keyHeader.BackgroundColor3 = Color3.fromRGB(18, 18, 18) keyHeader.BorderSizePixel = 0 keyHeader.ZIndex = 101 createCorner(keyHeader, 25) local keyHeaderDivider = Instance.new("Frame", keyHeader) keyHeaderDivider.Size = UDim2.new(1, 0, 0, 40) keyHeaderDivider.Position = UDim2.new(0, 0, 1, -40) keyHeaderDivider.BackgroundColor3 = Color3.fromRGB(18, 18, 18) keyHeaderDivider.BorderSizePixel = 0 keyHeaderDivider.ZIndex = 101 local keyIcon = Instance.new("ImageLabel", keyHeader) keyIcon.Size = UDim2.new(0, 50, 0, 50) keyIcon.Position = UDim2.new(0, 20, 0, 15) keyIcon.BackgroundTransparency = 1 keyIcon.Image = "rbxassetid://139409412034826" keyIcon.ScaleType = Enum.ScaleType.Fit keyIcon.ZIndex = 102 local keyTitle = Instance.new("TextLabel", keyHeader) keyTitle.Size = UDim2.new(0, 300, 0, 30) keyTitle.Position = UDim2.new(0, 80, 0, 15) keyTitle.BackgroundTransparency = 1 keyTitle.Text = "ROLI HUB" keyTitle.TextColor3 = Color3.fromRGB(255, 255, 255) keyTitle.Font = Enum.Font.GothamBold keyTitle.TextSize = 28 keyTitle.TextXAlignment = Enum.TextXAlignment.Left keyTitle.ZIndex = 102 local keySubtitle = Instance.new("TextLabel", keyHeader) keySubtitle.Size = UDim2.new(0, 300, 0, 20) keySubtitle.Position = UDim2.new(0, 80, 0, 48) keySubtitle.BackgroundTransparency = 1 keySubtitle.Text = "Dynamic Key System β€’ v2.0" keySubtitle.TextColor3 = COLORS.Primary keySubtitle.Font = Enum.Font.GothamBold keySubtitle.TextSize = 14 keySubtitle.TextXAlignment = Enum.TextXAlignment.Left keySubtitle.ZIndex = 102 local keyDesc = Instance.new("TextLabel", keyFrame) keyDesc.Size = UDim2.new(1, -40, 0, 30) keyDesc.Position = UDim2.new(0, 20, 0, 95) keyDesc.BackgroundTransparency = 1 keyDesc.Text = "πŸ” Get your access key through the link below" keyDesc.TextColor3 = Color3.fromRGB(180, 180, 180) keyDesc.Font = Enum.Font.Gotham keyDesc.TextSize = 13 keyDesc.TextWrapped = true keyDesc.ZIndex = 101 -- Get key button local getKeyBtn = Instance.new("TextButton", keyFrame) getKeyBtn.Size = UDim2.new(1, -40, 0, 42) getKeyBtn.Position = UDim2.new(0, 20, 0, 135) getKeyBtn.Text = "πŸ“‹ Click to Copy Key Link" getKeyBtn.BackgroundColor3 = Color3.fromRGB(30, 30, 30) getKeyBtn.TextColor3 = Color3.fromRGB(255, 255, 255) getKeyBtn.Font = Enum.Font.GothamBold getKeyBtn.TextSize = 14 getKeyBtn.BorderSizePixel = 0 getKeyBtn.AutoButtonColor = false getKeyBtn.ZIndex = 101 createCorner(getKeyBtn, 12) createStroke(getKeyBtn, COLORS.Primary, 2, 0.5) -- Key input local keyInputFrame = Instance.new("Frame", keyFrame) keyInputFrame.Size = UDim2.new(1, -40, 0, 50) keyInputFrame.Position = UDim2.new(0, 20, 0, 187) keyInputFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20) keyInputFrame.BorderSizePixel = 0 keyInputFrame.ZIndex = 101 createCorner(keyInputFrame, 12) local keyInputStroke = createStroke(keyInputFrame, Color3.fromRGB(40, 40, 40), 2) local keyBox = Instance.new("TextBox", keyInputFrame) keyBox.Size = UDim2.new(1, -30, 1, 0) keyBox.Position = UDim2.new(0, 15, 0, 0) keyBox.PlaceholderText = "Paste your key here..." keyBox.Font = Enum.Font.Gotham keyBox.TextSize = 15 keyBox.Text = "" keyBox.TextColor3 = Color3.fromRGB(255, 255, 255) keyBox.BackgroundTransparency = 1 keyBox.PlaceholderColor3 = Color3.fromRGB(100, 100, 100) keyBox.ClearTextOnFocus = false keyBox.ZIndex = 102 keyBox.Focused:Connect(function() tween(keyInputStroke, {Color = COLORS.Primary}, 0.2) end) keyBox.FocusLost:Connect(function() tween(keyInputStroke, {Color = Color3.fromRGB(40, 40, 40)}, 0.2) end) -- Submit button local submitBtn = Instance.new("TextButton", keyFrame) submitBtn.Size = UDim2.new(1, -40, 0, 52) submitBtn.Position = UDim2.new(0, 20, 0, 247) submitBtn.Text = "πŸš€ UNLOCK NOW" submitBtn.BackgroundColor3 = COLORS.Primary submitBtn.TextColor3 = Color3.fromRGB(255, 255, 255) submitBtn.Font = Enum.Font.GothamBold submitBtn.TextSize = 17 submitBtn.BorderSizePixel = 0 submitBtn.AutoButtonColor = false submitBtn.ZIndex = 101 createCorner(submitBtn, 12) createGlow(submitBtn, COLORS.Primary) -- ===== KEY SYSTEM LOGIC ===== getKeyBtn.MouseButton1Click:Connect(function() setclipboard(KEY_PAGE_LINK) notify("βœ… Copied!", "Key link copied! Paste in browser.", 3) tween(getKeyBtn, {BackgroundColor3 = COLORS.Success}, 0.2) wait(0.3) tween(getKeyBtn, {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}, 0.2) end) submitBtn.MouseButton1Click:Connect(function() local enteredKey = keyBox.Text:gsub("%s+", "") if enteredKey == CORRECT_KEY then -- Success tween(submitBtn, {BackgroundColor3 = COLORS.Success}, 0.2) tween(keyFrame, {BackgroundColor3 = Color3.fromRGB(20, 60, 20)}, 0.2) if saveKeyData() then notify("βœ… Success!", "Key saved! You won't need it again.", 4) else notify("βœ… Success!", "Key accepted! Loading script...", 3) end wait(0.5) tween(keyFrame, { Size = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0.5, 0, 0.5, 0) }, 0.5) wait(0.6) keyFrame:Destroy() loadMainScript() wait(2) if iconBtn then tween(iconBtn, {Size = UDim2.new(0, 0, 0, 0)}, 0.4) wait(0.5) gui:Destroy() end else -- Error keyBox.Text = "" keyBox.PlaceholderText = "❌ Invalid Key!" tween(keyFrame, {BackgroundColor3 = Color3.fromRGB(80, 15, 15)}, 0.15) tween(submitBtn, {BackgroundColor3 = COLORS.Error}, 0.15) tween(keyInputStroke, {Color = COLORS.Error}, 0.15) -- Shake local originalPos = keyFrame.Position for i = 1, 3 do keyFrame.Position = originalPos + UDim2.new(0, 10, 0, 0) wait(0.05) keyFrame.Position = originalPos - UDim2.new(0, 10, 0, 0) wait(0.05) end keyFrame.Position = originalPos wait(0.2) tween(keyFrame, {BackgroundColor3 = Color3.fromRGB(12, 12, 12)}, 0.3) tween(submitBtn, {BackgroundColor3 = COLORS.Primary}, 0.3) tween(keyInputStroke, {Color = Color3.fromRGB(40, 40, 40)}, 0.3) wait(1) keyBox.PlaceholderText = "Paste your key here..." notify("❌ Invalid Key!", "Please check your key and try again", 3) end end) -- ===== ICON BUTTON TOGGLE ===== iconBtn.MouseButton1Click:Connect(function() if keyFrame and keyFrame.Parent then keyFrame.Visible = not keyFrame.Visible if keyFrame.Visible then keyFrame.Size = UDim2.new(0, 0, 0, 0) keyFrame.Position = UDim2.new(0.5, 0, 0.5, 0) tween(keyFrame, { Size = UDim2.new(0, 420, 0, 320), Position = UDim2.new(0.5, -210, 0.5, -160) }, 0.5, Enum.EasingStyle.Back) end end end) -- ===== AUTO SHOW ON START ===== wait(0.5) keyFrame.Visible = true keyFrame.Size = UDim2.new(0, 0, 0, 0) keyFrame.Position = UDim2.new(0.5, 0, 0.5, 0) tween(keyFrame, { Size = UDim2.new(0, 420, 0, 320), Position = UDim2.new(0.5, -210, 0.5, -160) }, 0.6, Enum.EasingStyle.Back) notify("πŸ” ROLI Dynamic Key System", "Get your key through the link!", 4)