
10.2k Views
16 Executions
Key System
Key system script
Universal Script 📌
indonesiangamer777Published 10
3 years ago
Please login to perform these actions:Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
Key system script for all of you who need a key system script
-- Create a GUI for the key system
local keyGui = Instance.new("ScreenGui")
keyGui.Name = "KeyGui"
keyGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
-- Create a frame for the key input
local keyFrame = Instance.new("Frame")
keyFrame.Parent = keyGui
keyFrame.Size = UDim2.new(0.5, 0, 0.5, 0)
keyFrame.Position = UDim2.new(0.25, 0, 0.25, 0)
keyFrame.BackgroundTransparency = 0.5
-- Create a label for the key input
local keyLabel = Instance.new("TextLabel")
keyLabel.Parent = keyFrame
keyLabel.Size = UDim2.new(1, 0, 0.2, 0)
keyLabel.Position = UDim2.new(0, 0, 0, 0)
keyLabel.Text = "Enter the key to unlock it:"
-- Create a text box for the key input
local keyTextBox = Instance.new("TextBox")
keyTextBox.Parent = keyFrame
keyTextBox.Size = UDim2.new(1, 0, 0.2, 0)
keyTextBox.Position = UDim2.new(0, 0, 0.2, 0)
keyTextBox.BackgroundTransparency = 0.5
-- Create a button for submitting the key
local keyButton = Instance.new("TextButton")
keyButton.Parent = keyFrame
keyButton.Size = UDim2.new(1, 0, 0.2, 0)
keyButton.Position = UDim2.new(0, 0, 0.4, 0)
keyButton.BackgroundTransparency = 0.5
keyButton.Text = "Submit"
-- Create a BoolValue to track if the key has been entered correctly
local keyUnlocked = Instance.new("BoolValue")
keyUnlocked.Name = "KeyUnlocked"
keyUnlocked.Parent = keyGui
keyUnlocked.Value = false
Comments
0Log in to join the conversation. Login
No comments yet. Be the first!







