Generator
Key RequiredUniversal

Generator

Universal ScriptL1laqxzL1laqxz 294 views 7 executesUpdated Dec 28, 2025
Unrated
00
Lua Script•110 lines (3419 chars)
-- 6-Digit Code Generator Squircle GUI

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")

local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

math.randomseed(os.clock() * 100000)

-- ===== Functions =====
local function generate6DigitCode()
	return string.format("%06d", math.random(0, 999999))
end

local function applySquircle(frame, radius)
	local corner = Instance.new("UICorner")
	corner.CornerRadius = UDim.new(0, radius or 20)
	corner.Parent = frame
end

-- ===== GUI =====
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "CodeGeneratorGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = playerGui

local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.fromOffset(280, 160)
mainFrame.Position = UDim2.fromScale(0.5, 0.5)
mainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
mainFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
mainFrame.Active = true
mainFrame.Parent = screenGui
applySquircle(mainFrame, 24)

-- ===== Credit Text (Top Left) =====
local creditLabel = Instance.new("TextLabel")
creditLabel.Size = UDim2.fromOffset(160, 20)
creditLabel.Position = UDim2.fromOffset(10, 8)
creditLabel.BackgroundTransparency = 1
creditLabel.Text = "generator by l1laqxz"
creditLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
creditLabel.TextTransparency = 0.5 -- 50% transparent
creditLabel.Font = Enum.Font.Gotham
creditLabel.TextSize = 12
creditLabel.TextXAlignment = Enum.TextXAlignment.Left
creditLabel.TextYAlignment = Enum.TextYAlignment.Center
creditLabel.Parent = mainFrame

-- ===== Code Text =====
local codeLabel = Instance.new("TextLabel")
codeLabel.Size = UDim2.fromScale(1, 0.6)
codeLabel.Position = UDim2.fromScale(0, 0.2)
codeLabel.BackgroundTransparency = 1
codeLabel.Text = generate6DigitCode()
codeLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
codeLabel.Font = Enum.Font.GothamBold
codeLabel.TextScaled = true
codeLabel.Parent = mainFrame

-- ===== Regenerate Button =====
local regenButton = Instance.new("TextButton")
regenButton.Size = UDim2.fromOffset(110, 36)
regenButton.Position = UDim2.new(0, 12, 1, -48)
regenButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
regenButton.Text = "Regenerate"
regenButton.TextColor3 = Color3.fromRGB(255, 255, 255)
regenButton.Font = Enum.Font.Gotham
regenButton.TextSize = 14
regenButton.Parent = mainFrame
applySquircle(regenButton, 14)

regenButton.MouseButton1Click:Connect(function()
	codeLabel.Text = generate6DigitCode()
end)

-- ===== DRAG SYSTEM =====
local dragging = false
local dragStart
local startPos

mainFrame.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1
	or input.UserInputType == Enum.UserInputType.Touch then
		dragging = true
		dragStart = input.Position
		startPos = mainFrame.Position
	end
end)

mainFrame.InputEnded:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1
	or input.UserInputType == Enum.UserInputType.Touch then
		dragging = false
	end
end)

UserInputService.InputChanged:Connect(function(input)
	if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement
	or input.UserInputType == Enum.UserInputType.Touch) then
		local delta = input.Position - dragStart
		mainFrame.Position = UDim2.new(
			startPos.X.Scale,
			startPos.X.Offset + delta.X,
			startPos.Y.Scale,
			startPos.Y.Offset + delta.Y
		)
	end
end)

Features & Information

Generator

Community Comments (2)

romaegriscinromaegriscinDec 28, 2025

Ahh noobs freaky GD deco🥀

Replying to @romaegriscin
L1laqxzL1laqxzJan 8, 2026

@romaegriscin haha it's not mine >:D I decorate better than that

More Scripts for Universal Scripts