Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local UserInputService = game:GetService("UserInputService")
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = player:WaitForChild("PlayerGui")
- screenGui.ResetOnSpawn = false
- -- Correct Password
- local correctPassword = "MichealKaiser"
- -- Key UI Frame
- local keyFrame = Instance.new("Frame")
- keyFrame.Size = UDim2.new(0.3, 0, 0.3, 0)
- keyFrame.Position = UDim2.new(0.35, 0, 0.35, 0)
- keyFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- keyFrame.BorderSizePixel = 0
- keyFrame.Parent = screenGui
- local UICornerKey = Instance.new("UICorner", keyFrame)
- UICornerKey.CornerRadius = UDim.new(0.1, 0)
- -- Key Input Box
- local keyInput = Instance.new("TextBox")
- keyInput.Size = UDim2.new(0.8, 0, 0.2, 0)
- keyInput.Position = UDim2.new(0.1, 0, 0.3, 0)
- keyInput.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- keyInput.TextColor3 = Color3.fromRGB(255, 255, 255)
- keyInput.Text = "Enter Key Here"
- keyInput.Font = Enum.Font.Garamond
- keyInput.TextScaled = true
- keyInput.Parent = keyFrame
- local UICornerInput = Instance.new("UICorner", keyInput)
- UICornerInput.CornerRadius = UDim.new(0.2, 0)
- -- Submit Button
- local submitButton = Instance.new("TextButton")
- submitButton.Size = UDim2.new(0.8, 0, 0.2, 0)
- submitButton.Position = UDim2.new(0.1, 0, 0.6, 0)
- submitButton.BackgroundColor3 = Color3.fromRGB(70, 130, 180)
- submitButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- submitButton.Text = "Unlock"
- submitButton.Font = Enum.Font.Garamond
- submitButton.TextScaled = true
- submitButton.Parent = keyFrame
- local UICornerSubmit = Instance.new("UICorner", submitButton)
- UICornerSubmit.CornerRadius = UDim.new(0.2, 0)
- -- Error Message
- local errorMessage = Instance.new("TextLabel")
- errorMessage.Size = UDim2.new(1, 0, 0.1, 0)
- errorMessage.Position = UDim2.new(0, 0, 0.85, 0)
- errorMessage.BackgroundTransparency = 1
- errorMessage.TextColor3 = Color3.fromRGB(255, 0, 0)
- errorMessage.TextScaled = true
- errorMessage.Font = Enum.Font.Garamond
- errorMessage.Text = ""
- errorMessage.Parent = keyFrame
- -- Scrollable Main UI
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0.4, 0, 0.5, 0)
- mainFrame.Position = UDim2.new(0.3, 0, 0.25, 0)
- mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- mainFrame.BorderSizePixel = 0
- mainFrame.Parent = screenGui
- mainFrame.ClipsDescendants = true
- mainFrame.Visible = false
- local UICornerMain = Instance.new("UICorner", mainFrame)
- UICornerMain.CornerRadius = UDim.new(0.1, 0)
- -- Scrolling Frame
- local scrollFrame = Instance.new("ScrollingFrame")
- scrollFrame.Size = UDim2.new(1, 0, 1, 0)
- scrollFrame.CanvasSize = UDim2.new(0, 0, 2, 0) -- Adjust this based on content
- scrollFrame.ScrollBarThickness = 5
- scrollFrame.BackgroundTransparency = 1
- scrollFrame.Parent = mainFrame
- local UIListLayout = Instance.new("UIListLayout")
- UIListLayout.Parent = scrollFrame
- UIListLayout.Padding = UDim.new(0.02, 0)
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- -- Add UI Elements inside the scroll frame
- for i = 1, 10 do
- local optionButton = Instance.new("TextButton")
- optionButton.Size = UDim2.new(0.9, 0, 0.1, 0)
- optionButton.Position = UDim2.new(0.05, 0, 0, 0)
- optionButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- optionButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- optionButton.Font = Enum.Font.Garamond
- optionButton.Text = "Option " .. i
- optionButton.TextScaled = true
- optionButton.Parent = scrollFrame
- local UICornerOption = Instance.new("UICorner", optionButton)
- UICornerOption.CornerRadius = UDim.new(0.2, 0)
- end
- -- Close Button
- local closeButton = Instance.new("TextButton")
- closeButton.Size = UDim2.new(0.1, 0, 0.1, 0)
- closeButton.Position = UDim2.new(0.9, 0, 0, 0)
- closeButton.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
- closeButton.Text = "X"
- closeButton.Font = Enum.Font.Garamond
- closeButton.TextScaled = true
- closeButton.Parent = mainFrame
- -- Toggle Button
- local toggleButton = Instance.new("TextButton")
- toggleButton.Size = UDim2.new(0.07, 0, 0.07, 0)
- toggleButton.Position = UDim2.new(0.02, 0, 0.8, 0)
- toggleButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- toggleButton.BackgroundTransparency = 0.3
- toggleButton.BorderSizePixel = 1
- toggleButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
- toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleButton.Font = Enum.Font.Garamond
- toggleButton.Text = "Toggle UI"
- toggleButton.TextScaled = true
- toggleButton.Parent = screenGui
- toggleButton.Visible = false
- local UICornerToggle = Instance.new("UICorner", toggleButton)
- UICornerToggle.CornerRadius = UDim.new(0.2, 0)
- -- Key Check
- submitButton.MouseButton1Click:Connect(function()
- if keyInput.Text == correctPassword then
- keyFrame.Visible = false
- mainFrame.Visible = true
- else
- errorMessage.Text = "Incorrect Key!"
- wait(1)
- errorMessage.Text = ""
- end
- end)
- -- Toggle UI Visibility
- toggleButton.MouseButton1Click:Connect(function()
- mainFrame.Visible = true
- toggleButton.Visible = false
- end)
- -- Dragging Function (For UI Elements)
- local function makeDraggable(frame)
- local dragging
- local dragInput
- local dragStart
- local startPos
- local function onInputBegan(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = frame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end
- local function onInputChanged(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local delta = input.Position - dragStart
- frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end
- frame.InputBegan:Connect(onInputBegan)
- UserInputService.InputChanged:Connect(onInputChanged)
- end
- makeDraggable(mainFrame)
- makeDraggable(toggleButton)
- makeDraggable(keyFrame)
- -- Close Animation
- closeButton.MouseButton1Click:Connect(function()
- mainFrame.Visible = false
- toggleButton.Visible = true
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement