Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local function tw(obj, t, style, dir, props)
- return TweenService:Create(obj, TweenInfo.new(t, style or Enum.EasingStyle.Quad, dir or Enum.EasingDirection.Out), props)
- end
- local function after(t, fn)
- task.delay(t, fn)
- end
- local CubixKeySystem = {}
- CubixKeySystem.__index = CubixKeySystem
- function CubixKeySystem.new(config)
- local self = setmetatable({}, CubixKeySystem)
- local cfg = config or {}
- self._text = {
- welcome = cfg.WelcomeText or "Welcome to",
- title = cfg.TitleText or "Cubix MAX",
- placeholder = cfg.PlaceholderText or "CUBIX-XXXXXXXXXXXXXXXXX",
- exitLabel = cfg.ExitLabel or "Exit",
- pasteLabel = cfg.PasteLabel or "Paste",
- getKeyLabel = cfg.GetKeyLabel or "Get Key",
- }
- self._callbacks = {
- onCorrectKey = cfg.OnCorrectKey or function() end,
- onExit = cfg.OnExit or function() end,
- onGetKey = cfg.OnGetKey or function() end,
- }
- self._validKeys = cfg.ValidKeys or {}
- self:_build()
- self:_connect()
- self:_playEntry()
- return self
- end
- function CubixKeySystem:_build()
- local t = self._text
- self.Key_System = Instance.new("ScreenGui")
- self.Key_System.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- self.Key_System.ScreenInsets = Enum.ScreenInsets.None
- self.Key_System.DisplayOrder = 999999999999999999999999999999999999999999999999999999999999999999999
- self.Key_System.Name = "Key System"
- self.Frame = Instance.new("Frame")
- self.Frame.AnchorPoint = Vector2.new(0.5, 0.5)
- self.Frame.BackgroundColor3 = Color3.fromRGB(128, 128, 128)
- self.Frame.BorderColor = BrickColor.new("Really black")
- self.Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.Frame.BorderSizePixel = 0
- self.Frame.Position = UDim2.new(0.5, 0, 0.5, 0)
- self.Frame.Size = UDim2.new(1, 0, 1, 0)
- local bggradient = Instance.new("UIGradient")
- bggradient.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(93, 70, 129)), ColorSequenceKeypoint.new(1, Color3.fromRGB(51, 51, 76))})
- bggradient.Rotation = 102
- bggradient.Name = "bggradient"
- self.TextLabel = Instance.new("TextLabel")
- self.TextLabel.FontFace = Font.new("rbxassetid://11702779240", Enum.FontWeight.Heavy, Enum.FontStyle.Normal)
- self.TextLabel.Text = t.welcome
- self.TextLabel.TextColor = BrickColor.new("Institutional white")
- self.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- self.TextLabel.TextScaled = true
- self.TextLabel.TextSize = 14
- self.TextLabel.TextWrapped = true
- self.TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.TextLabel.BackgroundTransparency = 1
- self.TextLabel.BorderColor = BrickColor.new("Really black")
- self.TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.TextLabel.BorderSizePixel = 0
- self.TextLabel.Position = UDim2.new(0.2, 0, 0.14, 0)
- self.TextLabel.Size = UDim2.new(0.6, 0, 0.05, 0)
- self.TextLabel_2 = Instance.new("TextLabel")
- self.TextLabel_2.FontFace = Font.new("rbxassetid://11702779240", Enum.FontWeight.Heavy, Enum.FontStyle.Normal)
- self.TextLabel_2.Text = t.title
- self.TextLabel_2.TextColor = BrickColor.new("Pastel violet")
- self.TextLabel_2.TextColor3 = Color3.fromRGB(170, 170, 255)
- self.TextLabel_2.TextScaled = true
- self.TextLabel_2.TextSize = 14
- self.TextLabel_2.TextWrapped = true
- self.TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.TextLabel_2.BackgroundTransparency = 1
- self.TextLabel_2.BorderColor = BrickColor.new("Really black")
- self.TextLabel_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.TextLabel_2.BorderSizePixel = 0
- self.TextLabel_2.Position = UDim2.new(0.2, 0, 0.19, 0)
- self.TextLabel_2.Size = UDim2.new(0.6, 0, 0.08, 0)
- self.Frame_2 = Instance.new("Frame")
- self.Frame_2.AnchorPoint = Vector2.new(0.5, 0)
- self.Frame_2.BackgroundColor3 = Color3.fromRGB(52, 25, 53)
- self.Frame_2.BackgroundTransparency = 0.7
- self.Frame_2.BorderColor = BrickColor.new("Really black")
- self.Frame_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.Frame_2.BorderSizePixel = 0
- self.Frame_2.Position = UDim2.new(0.5, 0, 0.37, 0)
- self.Frame_2.Size = UDim2.new(0.67, 0, 0.5, 0)
- local UICorner_2 = Instance.new("UICorner")
- UICorner_2.CornerRadius = UDim.new(0.1, 0)
- local ImageLabel = Instance.new("ImageLabel")
- ImageLabel.Image = "rbxassetid://119320247722777"
- ImageLabel.ImageTransparency = 0.95
- ImageLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel.BackgroundTransparency = 1
- ImageLabel.BorderColor = BrickColor.new("Really black")
- ImageLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
- ImageLabel.BorderSizePixel = 0
- ImageLabel.Size = UDim2.new(1, 0, 1, 0)
- local UICorner_3 = Instance.new("UICorner")
- UICorner_3.CornerRadius = UDim.new(0.1, 0)
- local UIStroke = Instance.new("UIStroke")
- UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- UIStroke.BorderStrokePosition = Enum.BorderStrokePosition.Inner
- UIStroke.Color = Color3.fromRGB(255, 255, 255)
- UIStroke.Transparency = 0.97
- self.textboxtoggle = Instance.new("TextButton")
- self.textboxtoggle.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
- self.textboxtoggle.Text = ""
- self.textboxtoggle.TextColor = BrickColor.new("Really black")
- self.textboxtoggle.TextColor3 = Color3.fromRGB(0, 0, 0)
- self.textboxtoggle.TextSize = 14
- self.textboxtoggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.textboxtoggle.BackgroundTransparency = 0.92
- self.textboxtoggle.BorderColor = BrickColor.new("Really black")
- self.textboxtoggle.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.textboxtoggle.BorderSizePixel = 0
- self.textboxtoggle.Position = UDim2.new(0.05, 0, 0.14, 0)
- self.textboxtoggle.Size = UDim2.new(0.8, 0, 0.24, 0)
- self.textboxtoggle.Name = "textboxtoggle"
- local UICorner_4 = Instance.new("UICorner")
- UICorner_4.CornerRadius = UDim.new(0.3, 0)
- local UIStroke_2 = Instance.new("UIStroke")
- UIStroke_2.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- UIStroke_2.BorderStrokePosition = Enum.BorderStrokePosition.Inner
- UIStroke_2.Color = Color3.fromRGB(255, 255, 255)
- UIStroke_2.Transparency = 0.94
- local UIGradient = Instance.new("UIGradient")
- UIGradient.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
- UIGradient.Rotation = 87
- local UIGradient_2 = Instance.new("UIGradient")
- UIGradient_2.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
- UIGradient_2.Rotation = -95
- self.key = Instance.new("TextBox")
- self.key.CursorPosition = -1
- self.key.FontFace = Font.new("rbxassetid://12187365977", Enum.FontWeight.ExtraBold, Enum.FontStyle.Normal)
- self.key.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
- self.key.PlaceholderText = t.placeholder
- self.key.Text = ""
- self.key.TextColor = BrickColor.new("Institutional white")
- self.key.TextColor3 = Color3.fromRGB(255, 255, 255)
- self.key.TextScaled = true
- self.key.TextSize = 14
- self.key.TextWrapped = true
- self.key.TextXAlignment = Enum.TextXAlignment.Left
- self.key.AnchorPoint = Vector2.new(0, 0.5)
- self.key.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.key.BackgroundTransparency = 1
- self.key.BorderColor = BrickColor.new("Really black")
- self.key.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.key.BorderSizePixel = 0
- self.key.Position = UDim2.new(0.13, 0, 0.5, 0)
- self.key.Size = UDim2.new(0.85, 0, 0.35, 0)
- self.key.Name = "key"
- local ImageLabel_2 = Instance.new("ImageLabel")
- ImageLabel_2.Image = "rbxassetid://103770365680028"
- ImageLabel_2.ImageTransparency = 0.2
- ImageLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel_2.BackgroundTransparency = 1
- ImageLabel_2.BorderColor = BrickColor.new("Really black")
- ImageLabel_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
- ImageLabel_2.BorderSizePixel = 0
- ImageLabel_2.Position = UDim2.new(0.04, 0, 0.26, 0)
- ImageLabel_2.Size = UDim2.new(0.45, 0, 0.45, 0)
- ImageLabel_2.SizeConstraint = Enum.SizeConstraint.RelativeYY
- self.exit = Instance.new("TextButton")
- self.exit.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
- self.exit.Text = ""
- self.exit.TextColor = BrickColor.new("Really black")
- self.exit.TextColor3 = Color3.fromRGB(0, 0, 0)
- self.exit.TextSize = 14
- self.exit.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.exit.BackgroundTransparency = 0.9
- self.exit.BorderColor = BrickColor.new("Really black")
- self.exit.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.exit.BorderSizePixel = 0
- self.exit.Position = UDim2.new(0.05, 0, 0.62, 0)
- self.exit.Size = UDim2.new(0.18, 0, 0.18, 0)
- self.exit.Name = "exit"
- local UICorner_5 = Instance.new("UICorner")
- UICorner_5.CornerRadius = UDim.new(0.3, 0)
- local UIGradient_3 = Instance.new("UIGradient")
- UIGradient_3.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
- UIGradient_3.Rotation = -95
- local UIStroke_3 = Instance.new("UIStroke")
- UIStroke_3.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- UIStroke_3.BorderStrokePosition = Enum.BorderStrokePosition.Inner
- UIStroke_3.Color = Color3.fromRGB(255, 255, 255)
- UIStroke_3.Transparency = 0.94
- local UIGradient_4 = Instance.new("UIGradient")
- UIGradient_4.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
- UIGradient_4.Rotation = 87
- local ImageLabel_3 = Instance.new("ImageLabel")
- ImageLabel_3.Image = "rbxassetid://106351146859743"
- ImageLabel_3.ImageTransparency = 0.2
- ImageLabel_3.AnchorPoint = Vector2.new(0, 0.5)
- ImageLabel_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel_3.BackgroundTransparency = 1
- ImageLabel_3.BorderColor = BrickColor.new("Really black")
- ImageLabel_3.BorderColor3 = Color3.fromRGB(0, 0, 0)
- ImageLabel_3.BorderSizePixel = 0
- ImageLabel_3.Position = UDim2.new(0.1, 0, 0.5, 0)
- ImageLabel_3.Size = UDim2.new(0.5, 0, 0.5, 0)
- ImageLabel_3.SizeConstraint = Enum.SizeConstraint.RelativeYY
- self.ExitTextBtn = Instance.new("TextButton")
- self.ExitTextBtn.FontFace = Font.new("rbxassetid://12187373327", Enum.FontWeight.ExtraBold, Enum.FontStyle.Normal)
- self.ExitTextBtn.Text = t.exitLabel
- self.ExitTextBtn.TextColor = BrickColor.new("Institutional white")
- self.ExitTextBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- self.ExitTextBtn.TextScaled = true
- self.ExitTextBtn.TextSize = 14
- self.ExitTextBtn.TextWrapped = true
- self.ExitTextBtn.TextXAlignment = Enum.TextXAlignment.Left
- self.ExitTextBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.ExitTextBtn.BackgroundTransparency = 1
- self.ExitTextBtn.BorderColor = BrickColor.new("Really black")
- self.ExitTextBtn.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.ExitTextBtn.BorderSizePixel = 0
- self.ExitTextBtn.Interactable = false
- self.ExitTextBtn.Position = UDim2.new(0.42, 0, 0.27, 0)
- self.ExitTextBtn.Size = UDim2.new(0.45, 0, 0.45, 0)
- self.paste = Instance.new("TextButton")
- self.paste.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
- self.paste.Text = ""
- self.paste.TextColor = BrickColor.new("Really black")
- self.paste.TextColor3 = Color3.fromRGB(0, 0, 0)
- self.paste.TextSize = 14
- self.paste.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.paste.BackgroundTransparency = 0.9
- self.paste.BorderColor = BrickColor.new("Really black")
- self.paste.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.paste.BorderSizePixel = 0
- self.paste.Position = UDim2.new(0.25, 0, 0.62, 0)
- self.paste.Size = UDim2.new(0.21, 0, 0.18, 0)
- self.paste.Name = "paste"
- self.PasteTextBtn = Instance.new("TextButton")
- self.PasteTextBtn.FontFace = Font.new("rbxassetid://12187373327", Enum.FontWeight.ExtraBold, Enum.FontStyle.Normal)
- self.PasteTextBtn.Text = t.pasteLabel
- self.PasteTextBtn.TextColor = BrickColor.new("Institutional white")
- self.PasteTextBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- self.PasteTextBtn.TextScaled = true
- self.PasteTextBtn.TextSize = 14
- self.PasteTextBtn.TextWrapped = true
- self.PasteTextBtn.TextXAlignment = Enum.TextXAlignment.Left
- self.PasteTextBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.PasteTextBtn.BackgroundTransparency = 1
- self.PasteTextBtn.BorderColor = BrickColor.new("Really black")
- self.PasteTextBtn.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.PasteTextBtn.BorderSizePixel = 0
- self.PasteTextBtn.Interactable = false
- self.PasteTextBtn.Position = UDim2.new(0.34, 0, 0.27, 0)
- self.PasteTextBtn.Size = UDim2.new(0.45, 0, 0.45, 0)
- local UICorner_6 = Instance.new("UICorner")
- UICorner_6.CornerRadius = UDim.new(0.3, 0)
- local UIGradient_5 = Instance.new("UIGradient")
- UIGradient_5.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
- UIGradient_5.Rotation = -95
- local UIStroke_4 = Instance.new("UIStroke")
- UIStroke_4.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- UIStroke_4.BorderStrokePosition = Enum.BorderStrokePosition.Inner
- UIStroke_4.Color = Color3.fromRGB(255, 255, 255)
- UIStroke_4.Transparency = 0.94
- local UIGradient_6 = Instance.new("UIGradient")
- UIGradient_6.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
- UIGradient_6.Rotation = 87
- self.ImageLabel_4 = Instance.new("ImageLabel")
- self.ImageLabel_4.Image = "rbxassetid://138891916339154"
- self.ImageLabel_4.ImageTransparency = 0.2
- self.ImageLabel_4.AnchorPoint = Vector2.new(0, 0.5)
- self.ImageLabel_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.ImageLabel_4.BackgroundTransparency = 1
- self.ImageLabel_4.BorderColor = BrickColor.new("Really black")
- self.ImageLabel_4.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.ImageLabel_4.BorderSizePixel = 0
- self.ImageLabel_4.Position = UDim2.new(0.1, 0, 0.5, 0)
- self.ImageLabel_4.Size = UDim2.new(0.5, 0, 0.5, 0)
- self.ImageLabel_4.SizeConstraint = Enum.SizeConstraint.RelativeYY
- self.get = Instance.new("TextButton")
- self.get.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
- self.get.Text = ""
- self.get.TextColor = BrickColor.new("Really black")
- self.get.TextColor3 = Color3.fromRGB(0, 0, 0)
- self.get.TextSize = 14
- self.get.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.get.BackgroundTransparency = 0.9
- self.get.BorderColor = BrickColor.new("Really black")
- self.get.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.get.BorderSizePixel = 0
- self.get.Position = UDim2.new(0.74, 0, 0.62, 0)
- self.get.Size = UDim2.new(0.21, 0, 0.18, 0)
- self.get.Name = "get"
- self.GetTextBtn = Instance.new("TextButton")
- self.GetTextBtn.FontFace = Font.new("rbxassetid://12187373327", Enum.FontWeight.ExtraBold, Enum.FontStyle.Normal)
- self.GetTextBtn.Text = t.getKeyLabel
- self.GetTextBtn.TextColor = BrickColor.new("Institutional white")
- self.GetTextBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- self.GetTextBtn.TextScaled = true
- self.GetTextBtn.TextSize = 14
- self.GetTextBtn.TextWrapped = true
- self.GetTextBtn.TextXAlignment = Enum.TextXAlignment.Left
- self.GetTextBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.GetTextBtn.BackgroundTransparency = 1
- self.GetTextBtn.BorderColor = BrickColor.new("Really black")
- self.GetTextBtn.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.GetTextBtn.BorderSizePixel = 0
- self.GetTextBtn.Interactable = false
- self.GetTextBtn.Position = UDim2.new(0.34, 0, 0.27, 0)
- self.GetTextBtn.Size = UDim2.new(0.66, 0, 0.45, 0)
- local UICorner_7 = Instance.new("UICorner")
- UICorner_7.CornerRadius = UDim.new(0.3, 0)
- local UIGradient_7 = Instance.new("UIGradient")
- UIGradient_7.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
- UIGradient_7.Rotation = -95
- local UIStroke_5 = Instance.new("UIStroke")
- UIStroke_5.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- UIStroke_5.BorderStrokePosition = Enum.BorderStrokePosition.Inner
- UIStroke_5.Color = Color3.fromRGB(255, 255, 255)
- UIStroke_5.Transparency = 0.94
- local UIGradient_8 = Instance.new("UIGradient")
- UIGradient_8.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
- UIGradient_8.Rotation = 87
- local ImageLabel_5 = Instance.new("ImageLabel")
- ImageLabel_5.Image = "rbxassetid://136880030971951"
- ImageLabel_5.ImageTransparency = 0.2
- ImageLabel_5.ScaleType = Enum.ScaleType.Fit
- ImageLabel_5.AnchorPoint = Vector2.new(0, 0.5)
- ImageLabel_5.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel_5.BackgroundTransparency = 1
- ImageLabel_5.BorderColor = BrickColor.new("Really black")
- ImageLabel_5.BorderColor3 = Color3.fromRGB(0, 0, 0)
- ImageLabel_5.BorderSizePixel = 0
- ImageLabel_5.Position = UDim2.new(0.1, 0, 0.5, 0)
- ImageLabel_5.Size = UDim2.new(0.55, 0, 0.55, 0)
- ImageLabel_5.SizeConstraint = Enum.SizeConstraint.RelativeYY
- self.enter = Instance.new("TextButton")
- self.enter.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
- self.enter.Text = ""
- self.enter.TextColor = BrickColor.new("Really black")
- self.enter.TextColor3 = Color3.fromRGB(0, 0, 0)
- self.enter.TextSize = 14
- self.enter.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- self.enter.BackgroundTransparency = 0.9
- self.enter.BorderColor = BrickColor.new("Really black")
- self.enter.BorderColor3 = Color3.fromRGB(0, 0, 0)
- self.enter.BorderSizePixel = 0
- self.enter.Position = UDim2.new(0.86, 0, 0.14, 0)
- self.enter.Size = UDim2.new(0.24, 0, 0.24, 0)
- self.enter.SizeConstraint = Enum.SizeConstraint.RelativeYY
- self.enter.Name = "enter"
- local UICorner_8 = Instance.new("UICorner")
- UICorner_8.CornerRadius = UDim.new(0.3, 0)
- local UIGradient_9 = Instance.new("UIGradient")
- UIGradient_9.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
- UIGradient_9.Rotation = -95
- local UIStroke_6 = Instance.new("UIStroke")
- UIStroke_6.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- UIStroke_6.BorderStrokePosition = Enum.BorderStrokePosition.Inner
- UIStroke_6.Color = Color3.fromRGB(255, 255, 255)
- UIStroke_6.Transparency = 0.94
- local UIGradient_10 = Instance.new("UIGradient")
- UIGradient_10.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
- UIGradient_10.Rotation = 87
- local ImageLabel_6 = Instance.new("ImageLabel")
- ImageLabel_6.Image = "rbxassetid://132729169219715"
- ImageLabel_6.ImageTransparency = 0.2
- ImageLabel_6.ScaleType = Enum.ScaleType.Fit
- ImageLabel_6.AnchorPoint = Vector2.new(0.5, 0.5)
- ImageLabel_6.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel_6.BackgroundTransparency = 1
- ImageLabel_6.BorderColor = BrickColor.new("Really black")
- ImageLabel_6.BorderColor3 = Color3.fromRGB(0, 0, 0)
- ImageLabel_6.BorderSizePixel = 0
- ImageLabel_6.Position = UDim2.new(0.5, 0, 0.5, 0)
- ImageLabel_6.Size = UDim2.new(0.4, 0, 0.4, 0)
- ImageLabel_6.SizeConstraint = Enum.SizeConstraint.RelativeYY
- local ImageLabel_7 = Instance.new("ImageLabel")
- ImageLabel_7.Image = "rbxassetid://119320247722777"
- ImageLabel_7.ImageTransparency = 0.9
- ImageLabel_7.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel_7.BackgroundTransparency = 1
- ImageLabel_7.BorderColor = BrickColor.new("Really black")
- ImageLabel_7.BorderColor3 = Color3.fromRGB(0, 0, 0)
- ImageLabel_7.BorderSizePixel = 0
- ImageLabel_7.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel_7.Visible = false
- local UIStroke_7 = Instance.new("UIStroke")
- UIStroke_7.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- UIStroke_7.BorderStrokePosition = Enum.BorderStrokePosition.Inner
- UIStroke_7.Color = Color3.fromRGB(255, 255, 255)
- UIStroke_7.Transparency = 0.93
- local UICorner_9 = Instance.new("UICorner")
- UICorner_9.CornerRadius = UDim.new(0.03, 0)
- self.Key_System.Parent = gethui()
- self.Frame.Parent = self.Key_System
- bggradient.Parent = self.Frame
- self.TextLabel.Parent = self.Frame
- self.TextLabel_2.Parent = self.Frame
- self.Frame_2.Parent = self.Frame
- UICorner_2.Parent = self.Frame_2
- ImageLabel.Parent = self.Frame_2
- UICorner_3.Parent = ImageLabel
- UIStroke.Parent = ImageLabel
- self.textboxtoggle.Parent = self.Frame_2
- UICorner_4.Parent = self.textboxtoggle
- UIStroke_2.Parent = self.textboxtoggle
- UIGradient.Parent = UIStroke_2
- UIGradient_2.Parent = self.textboxtoggle
- self.key.Parent = self.textboxtoggle
- ImageLabel_2.Parent = self.textboxtoggle
- self.exit.Parent = self.Frame_2
- UICorner_5.Parent = self.exit
- UIGradient_3.Parent = self.exit
- UIStroke_3.Parent = self.exit
- UIGradient_4.Parent = UIStroke_3
- ImageLabel_3.Parent = self.exit
- self.ExitTextBtn.Parent = self.exit
- self.paste.Parent = self.Frame_2
- self.PasteTextBtn.Parent = self.paste
- UICorner_6.Parent = self.paste
- UIGradient_5.Parent = self.paste
- UIStroke_4.Parent = self.paste
- UIGradient_6.Parent = UIStroke_4
- self.ImageLabel_4.Parent = self.paste
- self.get.Parent = self.Frame_2
- self.GetTextBtn.Parent = self.get
- UICorner_7.Parent = self.get
- UIGradient_7.Parent = self.get
- UIStroke_5.Parent = self.get
- UIGradient_8.Parent = UIStroke_5
- ImageLabel_5.Parent = self.get
- self.enter.Parent = self.Frame_2
- UICorner_8.Parent = self.enter
- UIGradient_9.Parent = self.enter
- UIStroke_6.Parent = self.enter
- UIGradient_10.Parent = UIStroke_6
- ImageLabel_6.Parent = self.enter
- ImageLabel_7.Parent = self.Frame
- UIStroke_7.Parent = ImageLabel_7
- UICorner_9.Parent = ImageLabel_7
- self._il2 = ImageLabel_2
- self._il3 = ImageLabel_3
- self._il5 = ImageLabel_5
- self._il6 = ImageLabel_6
- end
- function CubixKeySystem:_pressAnim(btn)
- local ox = btn.Size.X.Scale
- local oy = btn.Size.Y.Scale
- local op = btn.Position
- local nx = ox * 0.91
- local ny = oy * 0.91
- local npx = op.X.Scale + (ox - nx) / 2
- local npy = op.Y.Scale + (oy - ny) / 2
- local down = tw(btn, 0.09, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, {
- Size = UDim2.new(nx, 0, ny, 0),
- Position = UDim2.new(npx, 0, npy, 0),
- BackgroundTransparency = 0.75,
- })
- down:Play()
- down.Completed:Connect(function()
- tw(btn, 0.18, Enum.EasingStyle.Back, Enum.EasingDirection.Out, {
- Size = UDim2.new(ox, 0, oy, 0),
- Position = op,
- BackgroundTransparency = 0.9,
- }):Play()
- end)
- end
- function CubixKeySystem:_playExit(cb)
- tw(self.TextLabel, 0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.In, { TextTransparency = 1 }):Play()
- tw(self.TextLabel_2, 0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.In, { TextTransparency = 1 }):Play()
- after(0.15, function()
- local panelOut = tw(self.Frame_2, 0.4, Enum.EasingStyle.Back, Enum.EasingDirection.In, {
- Position = UDim2.new(0.5, 0, 0.68, 0),
- BackgroundTransparency = 1,
- })
- panelOut:Play()
- panelOut.Completed:Connect(function()
- local bgOut = tw(self.Frame, 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.In, {
- BackgroundTransparency = 1,
- })
- bgOut:Play()
- bgOut.Completed:Connect(function()
- self.Key_System:Destroy()
- if cb then cb() end
- end)
- end)
- end)
- end
- function CubixKeySystem:_playEntry()
- self.Frame.BackgroundTransparency = 1
- self.TextLabel.TextTransparency = 1
- self.TextLabel_2.TextTransparency = 1
- self.Frame_2.BackgroundTransparency = 1
- self.Frame_2.Position = UDim2.new(0.5, 0, 0.52, 0)
- self.textboxtoggle.BackgroundTransparency = 1
- self.exit.BackgroundTransparency = 1
- self.paste.BackgroundTransparency = 1
- self.get.BackgroundTransparency = 1
- self.enter.BackgroundTransparency = 1
- self._il2.ImageTransparency = 1
- self._il3.ImageTransparency = 1
- self.ImageLabel_4.ImageTransparency = 1
- self._il5.ImageTransparency = 1
- self._il6.ImageTransparency = 1
- self.ExitTextBtn.TextTransparency = 1
- self.PasteTextBtn.TextTransparency = 1
- self.GetTextBtn.TextTransparency = 1
- tw(self.Frame, 0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { BackgroundTransparency = 0 }):Play()
- after(0.3, function()
- tw(self.TextLabel, 0.45, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
- end)
- after(0.5, function()
- tw(self.TextLabel_2, 0.45, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
- end)
- after(0.7, function()
- tw(self.Frame_2, 0.55, Enum.EasingStyle.Back, Enum.EasingDirection.Out, {
- Position = UDim2.new(0.5, 0, 0.37, 0),
- BackgroundTransparency = 0.7,
- }):Play()
- end)
- after(0.95, function()
- tw(self.textboxtoggle, 0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { BackgroundTransparency = 0.92 }):Play()
- tw(self._il2, 0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
- end)
- after(1.1, function()
- tw(self.enter, 0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { BackgroundTransparency = 0.9 }):Play()
- tw(self._il6, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
- end)
- after(1.25, function()
- tw(self.exit, 0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { BackgroundTransparency = 0.9 }):Play()
- tw(self._il3, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
- tw(self.ExitTextBtn, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
- end)
- after(1.4, function()
- tw(self.paste, 0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { BackgroundTransparency = 0.9 }):Play()
- tw(self.ImageLabel_4, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
- tw(self.PasteTextBtn, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
- end)
- after(1.55, function()
- tw(self.get, 0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { BackgroundTransparency = 0.9 }):Play()
- tw(self._il5, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
- tw(self.GetTextBtn, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
- end)
- end
- function CubixKeySystem:_connect()
- self.exit.MouseButton1Click:Connect(function()
- self:_pressAnim(self.exit)
- after(0.1, function()
- self:_playExit(function()
- self._callbacks.onExit()
- end)
- end)
- end)
- self.paste.MouseButton1Click:Connect(function()
- self:_pressAnim(self.paste)
- after(0.1, function()
- pcall(function()
- local clip = getclipboard and getclipboard() or ""
- if #clip > 0 then self.key.Text = clip end
- end)
- end)
- end)
- self.get.MouseButton1Click:Connect(function()
- self:_pressAnim(self.get)
- after(0.1, function()
- self._callbacks.onGetKey()
- end)
- end)
- self.enter.MouseButton1Click:Connect(function()
- self:_pressAnim(self.enter)
- after(0.1, function()
- local input = self.key.Text
- if self._validKeys[input] then
- self:_playExit(function()
- self._callbacks.onCorrectKey(input)
- end)
- else
- local base = self.textboxtoggle.Position
- local offsets = {-0.04, 0.04, -0.03, 0.03, -0.02, 0.02, -0.01, 0.01, 0}
- local idx = 0
- local function step()
- idx = idx + 1
- if offsets[idx] then
- local s = tw(self.textboxtoggle, 0.04, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, {
- Position = UDim2.new(base.X.Scale + offsets[idx], 0, base.Y.Scale, 0),
- })
- s:Play()
- s.Completed:Connect(step)
- end
- end
- step()
- end
- end)
- end)
- end
- return CubixKeySystem
- --[[
- ========== EXAMPLE USAGE ==========
- local KeySystem = loadstring(game:HttpGet("your_raw_link_here"))()
- local ks = KeySystem.new({
- WelcomeText = "Welcome to",
- TitleText = "Rosava Hub",
- PlaceholderText = "ROSAVA-XXXXXXXXXXXX",
- ExitLabel = "Exit",
- PasteLabel = "Paste",
- GetKeyLabel = "Get Key",
- ValidKeys = {
- ["ROSAVA-ABC123"] = true,
- ["ROSAVA-XYZ999"] = true,
- },
- OnCorrectKey = function(key)
- print("Correct key entered:", key)
- end,
- OnExit = function()
- print("User exited")
- end,
- OnGetKey = function()
- if setclipboard then
- setclipboard("https://discord.gg/yourserver")
- end
- end,
- })
- ]]
Advertisement
Add Comment
Please, Sign In to add comment