Messi33536086

Untitled

Mar 22nd, 2026 (edited)
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.48 KB | None | 0 0
  1. local TweenService = game:GetService("TweenService")
  2.  
  3. local function tw(obj, t, style, dir, props)
  4. return TweenService:Create(obj, TweenInfo.new(t, style or Enum.EasingStyle.Quad, dir or Enum.EasingDirection.Out), props)
  5. end
  6.  
  7. local function after(t, fn)
  8. task.delay(t, fn)
  9. end
  10.  
  11. local CubixKeySystem = {}
  12. CubixKeySystem.__index = CubixKeySystem
  13.  
  14. function CubixKeySystem.new(config)
  15. local self = setmetatable({}, CubixKeySystem)
  16.  
  17. local cfg = config or {}
  18.  
  19. self._text = {
  20. welcome = cfg.WelcomeText or "Welcome to",
  21. title = cfg.TitleText or "Cubix MAX",
  22. placeholder = cfg.PlaceholderText or "CUBIX-XXXXXXXXXXXXXXXXX",
  23. exitLabel = cfg.ExitLabel or "Exit",
  24. pasteLabel = cfg.PasteLabel or "Paste",
  25. getKeyLabel = cfg.GetKeyLabel or "Get Key",
  26. }
  27.  
  28. self._callbacks = {
  29. onCorrectKey = cfg.OnCorrectKey or function() end,
  30. onExit = cfg.OnExit or function() end,
  31. onGetKey = cfg.OnGetKey or function() end,
  32. }
  33.  
  34. self._validKeys = cfg.ValidKeys or {}
  35.  
  36. self:_build()
  37. self:_connect()
  38. self:_playEntry()
  39.  
  40. return self
  41. end
  42.  
  43. function CubixKeySystem:_build()
  44. local t = self._text
  45.  
  46. self.Key_System = Instance.new("ScreenGui")
  47. self.Key_System.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  48. self.Key_System.ScreenInsets = Enum.ScreenInsets.None
  49. self.Key_System.DisplayOrder = 999999999999999999999999999999999999999999999999999999999999999999999
  50. self.Key_System.Name = "Key System"
  51.  
  52. self.Frame = Instance.new("Frame")
  53. self.Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  54. self.Frame.BackgroundColor3 = Color3.fromRGB(128, 128, 128)
  55. self.Frame.BorderColor = BrickColor.new("Really black")
  56. self.Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  57. self.Frame.BorderSizePixel = 0
  58. self.Frame.Position = UDim2.new(0.5, 0, 0.5, 0)
  59. self.Frame.Size = UDim2.new(1, 0, 1, 0)
  60.  
  61. local bggradient = Instance.new("UIGradient")
  62. bggradient.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(93, 70, 129)), ColorSequenceKeypoint.new(1, Color3.fromRGB(51, 51, 76))})
  63. bggradient.Rotation = 102
  64. bggradient.Name = "bggradient"
  65.  
  66. self.TextLabel = Instance.new("TextLabel")
  67. self.TextLabel.FontFace = Font.new("rbxassetid://11702779240", Enum.FontWeight.Heavy, Enum.FontStyle.Normal)
  68. self.TextLabel.Text = t.welcome
  69. self.TextLabel.TextColor = BrickColor.new("Institutional white")
  70. self.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  71. self.TextLabel.TextScaled = true
  72. self.TextLabel.TextSize = 14
  73. self.TextLabel.TextWrapped = true
  74. self.TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  75. self.TextLabel.BackgroundTransparency = 1
  76. self.TextLabel.BorderColor = BrickColor.new("Really black")
  77. self.TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
  78. self.TextLabel.BorderSizePixel = 0
  79. self.TextLabel.Position = UDim2.new(0.2, 0, 0.14, 0)
  80. self.TextLabel.Size = UDim2.new(0.6, 0, 0.05, 0)
  81.  
  82. self.TextLabel_2 = Instance.new("TextLabel")
  83. self.TextLabel_2.FontFace = Font.new("rbxassetid://11702779240", Enum.FontWeight.Heavy, Enum.FontStyle.Normal)
  84. self.TextLabel_2.Text = t.title
  85. self.TextLabel_2.TextColor = BrickColor.new("Pastel violet")
  86. self.TextLabel_2.TextColor3 = Color3.fromRGB(170, 170, 255)
  87. self.TextLabel_2.TextScaled = true
  88. self.TextLabel_2.TextSize = 14
  89. self.TextLabel_2.TextWrapped = true
  90. self.TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  91. self.TextLabel_2.BackgroundTransparency = 1
  92. self.TextLabel_2.BorderColor = BrickColor.new("Really black")
  93. self.TextLabel_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
  94. self.TextLabel_2.BorderSizePixel = 0
  95. self.TextLabel_2.Position = UDim2.new(0.2, 0, 0.19, 0)
  96. self.TextLabel_2.Size = UDim2.new(0.6, 0, 0.08, 0)
  97.  
  98. self.Frame_2 = Instance.new("Frame")
  99. self.Frame_2.AnchorPoint = Vector2.new(0.5, 0)
  100. self.Frame_2.BackgroundColor3 = Color3.fromRGB(52, 25, 53)
  101. self.Frame_2.BackgroundTransparency = 0.7
  102. self.Frame_2.BorderColor = BrickColor.new("Really black")
  103. self.Frame_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
  104. self.Frame_2.BorderSizePixel = 0
  105. self.Frame_2.Position = UDim2.new(0.5, 0, 0.37, 0)
  106. self.Frame_2.Size = UDim2.new(0.67, 0, 0.5, 0)
  107.  
  108. local UICorner_2 = Instance.new("UICorner")
  109. UICorner_2.CornerRadius = UDim.new(0.1, 0)
  110.  
  111. local ImageLabel = Instance.new("ImageLabel")
  112. ImageLabel.Image = "rbxassetid://119320247722777"
  113. ImageLabel.ImageTransparency = 0.95
  114. ImageLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  115. ImageLabel.BackgroundTransparency = 1
  116. ImageLabel.BorderColor = BrickColor.new("Really black")
  117. ImageLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
  118. ImageLabel.BorderSizePixel = 0
  119. ImageLabel.Size = UDim2.new(1, 0, 1, 0)
  120.  
  121. local UICorner_3 = Instance.new("UICorner")
  122. UICorner_3.CornerRadius = UDim.new(0.1, 0)
  123.  
  124. local UIStroke = Instance.new("UIStroke")
  125. UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  126. UIStroke.BorderStrokePosition = Enum.BorderStrokePosition.Inner
  127. UIStroke.Color = Color3.fromRGB(255, 255, 255)
  128. UIStroke.Transparency = 0.97
  129.  
  130. self.textboxtoggle = Instance.new("TextButton")
  131. self.textboxtoggle.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
  132. self.textboxtoggle.Text = ""
  133. self.textboxtoggle.TextColor = BrickColor.new("Really black")
  134. self.textboxtoggle.TextColor3 = Color3.fromRGB(0, 0, 0)
  135. self.textboxtoggle.TextSize = 14
  136. self.textboxtoggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  137. self.textboxtoggle.BackgroundTransparency = 0.92
  138. self.textboxtoggle.BorderColor = BrickColor.new("Really black")
  139. self.textboxtoggle.BorderColor3 = Color3.fromRGB(0, 0, 0)
  140. self.textboxtoggle.BorderSizePixel = 0
  141. self.textboxtoggle.Position = UDim2.new(0.05, 0, 0.14, 0)
  142. self.textboxtoggle.Size = UDim2.new(0.8, 0, 0.24, 0)
  143. self.textboxtoggle.Name = "textboxtoggle"
  144.  
  145. local UICorner_4 = Instance.new("UICorner")
  146. UICorner_4.CornerRadius = UDim.new(0.3, 0)
  147.  
  148. local UIStroke_2 = Instance.new("UIStroke")
  149. UIStroke_2.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  150. UIStroke_2.BorderStrokePosition = Enum.BorderStrokePosition.Inner
  151. UIStroke_2.Color = Color3.fromRGB(255, 255, 255)
  152. UIStroke_2.Transparency = 0.94
  153.  
  154. local UIGradient = Instance.new("UIGradient")
  155. UIGradient.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  156. UIGradient.Rotation = 87
  157.  
  158. local UIGradient_2 = Instance.new("UIGradient")
  159. UIGradient_2.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
  160. UIGradient_2.Rotation = -95
  161.  
  162. self.key = Instance.new("TextBox")
  163. self.key.CursorPosition = -1
  164. self.key.FontFace = Font.new("rbxassetid://12187365977", Enum.FontWeight.ExtraBold, Enum.FontStyle.Normal)
  165. self.key.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  166. self.key.PlaceholderText = t.placeholder
  167. self.key.Text = ""
  168. self.key.TextColor = BrickColor.new("Institutional white")
  169. self.key.TextColor3 = Color3.fromRGB(255, 255, 255)
  170. self.key.TextScaled = true
  171. self.key.TextSize = 14
  172. self.key.TextWrapped = true
  173. self.key.TextXAlignment = Enum.TextXAlignment.Left
  174. self.key.AnchorPoint = Vector2.new(0, 0.5)
  175. self.key.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  176. self.key.BackgroundTransparency = 1
  177. self.key.BorderColor = BrickColor.new("Really black")
  178. self.key.BorderColor3 = Color3.fromRGB(0, 0, 0)
  179. self.key.BorderSizePixel = 0
  180. self.key.Position = UDim2.new(0.13, 0, 0.5, 0)
  181. self.key.Size = UDim2.new(0.85, 0, 0.35, 0)
  182. self.key.Name = "key"
  183.  
  184. local ImageLabel_2 = Instance.new("ImageLabel")
  185. ImageLabel_2.Image = "rbxassetid://103770365680028"
  186. ImageLabel_2.ImageTransparency = 0.2
  187. ImageLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  188. ImageLabel_2.BackgroundTransparency = 1
  189. ImageLabel_2.BorderColor = BrickColor.new("Really black")
  190. ImageLabel_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
  191. ImageLabel_2.BorderSizePixel = 0
  192. ImageLabel_2.Position = UDim2.new(0.04, 0, 0.26, 0)
  193. ImageLabel_2.Size = UDim2.new(0.45, 0, 0.45, 0)
  194. ImageLabel_2.SizeConstraint = Enum.SizeConstraint.RelativeYY
  195.  
  196. self.exit = Instance.new("TextButton")
  197. self.exit.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
  198. self.exit.Text = ""
  199. self.exit.TextColor = BrickColor.new("Really black")
  200. self.exit.TextColor3 = Color3.fromRGB(0, 0, 0)
  201. self.exit.TextSize = 14
  202. self.exit.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  203. self.exit.BackgroundTransparency = 0.9
  204. self.exit.BorderColor = BrickColor.new("Really black")
  205. self.exit.BorderColor3 = Color3.fromRGB(0, 0, 0)
  206. self.exit.BorderSizePixel = 0
  207. self.exit.Position = UDim2.new(0.05, 0, 0.62, 0)
  208. self.exit.Size = UDim2.new(0.18, 0, 0.18, 0)
  209. self.exit.Name = "exit"
  210.  
  211. local UICorner_5 = Instance.new("UICorner")
  212. UICorner_5.CornerRadius = UDim.new(0.3, 0)
  213.  
  214. local UIGradient_3 = Instance.new("UIGradient")
  215. UIGradient_3.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
  216. UIGradient_3.Rotation = -95
  217.  
  218. local UIStroke_3 = Instance.new("UIStroke")
  219. UIStroke_3.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  220. UIStroke_3.BorderStrokePosition = Enum.BorderStrokePosition.Inner
  221. UIStroke_3.Color = Color3.fromRGB(255, 255, 255)
  222. UIStroke_3.Transparency = 0.94
  223.  
  224. local UIGradient_4 = Instance.new("UIGradient")
  225. UIGradient_4.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  226. UIGradient_4.Rotation = 87
  227.  
  228. local ImageLabel_3 = Instance.new("ImageLabel")
  229. ImageLabel_3.Image = "rbxassetid://106351146859743"
  230. ImageLabel_3.ImageTransparency = 0.2
  231. ImageLabel_3.AnchorPoint = Vector2.new(0, 0.5)
  232. ImageLabel_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  233. ImageLabel_3.BackgroundTransparency = 1
  234. ImageLabel_3.BorderColor = BrickColor.new("Really black")
  235. ImageLabel_3.BorderColor3 = Color3.fromRGB(0, 0, 0)
  236. ImageLabel_3.BorderSizePixel = 0
  237. ImageLabel_3.Position = UDim2.new(0.1, 0, 0.5, 0)
  238. ImageLabel_3.Size = UDim2.new(0.5, 0, 0.5, 0)
  239. ImageLabel_3.SizeConstraint = Enum.SizeConstraint.RelativeYY
  240.  
  241. self.ExitTextBtn = Instance.new("TextButton")
  242. self.ExitTextBtn.FontFace = Font.new("rbxassetid://12187373327", Enum.FontWeight.ExtraBold, Enum.FontStyle.Normal)
  243. self.ExitTextBtn.Text = t.exitLabel
  244. self.ExitTextBtn.TextColor = BrickColor.new("Institutional white")
  245. self.ExitTextBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  246. self.ExitTextBtn.TextScaled = true
  247. self.ExitTextBtn.TextSize = 14
  248. self.ExitTextBtn.TextWrapped = true
  249. self.ExitTextBtn.TextXAlignment = Enum.TextXAlignment.Left
  250. self.ExitTextBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  251. self.ExitTextBtn.BackgroundTransparency = 1
  252. self.ExitTextBtn.BorderColor = BrickColor.new("Really black")
  253. self.ExitTextBtn.BorderColor3 = Color3.fromRGB(0, 0, 0)
  254. self.ExitTextBtn.BorderSizePixel = 0
  255. self.ExitTextBtn.Interactable = false
  256. self.ExitTextBtn.Position = UDim2.new(0.42, 0, 0.27, 0)
  257. self.ExitTextBtn.Size = UDim2.new(0.45, 0, 0.45, 0)
  258.  
  259. self.paste = Instance.new("TextButton")
  260. self.paste.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
  261. self.paste.Text = ""
  262. self.paste.TextColor = BrickColor.new("Really black")
  263. self.paste.TextColor3 = Color3.fromRGB(0, 0, 0)
  264. self.paste.TextSize = 14
  265. self.paste.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  266. self.paste.BackgroundTransparency = 0.9
  267. self.paste.BorderColor = BrickColor.new("Really black")
  268. self.paste.BorderColor3 = Color3.fromRGB(0, 0, 0)
  269. self.paste.BorderSizePixel = 0
  270. self.paste.Position = UDim2.new(0.25, 0, 0.62, 0)
  271. self.paste.Size = UDim2.new(0.21, 0, 0.18, 0)
  272. self.paste.Name = "paste"
  273.  
  274. self.PasteTextBtn = Instance.new("TextButton")
  275. self.PasteTextBtn.FontFace = Font.new("rbxassetid://12187373327", Enum.FontWeight.ExtraBold, Enum.FontStyle.Normal)
  276. self.PasteTextBtn.Text = t.pasteLabel
  277. self.PasteTextBtn.TextColor = BrickColor.new("Institutional white")
  278. self.PasteTextBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  279. self.PasteTextBtn.TextScaled = true
  280. self.PasteTextBtn.TextSize = 14
  281. self.PasteTextBtn.TextWrapped = true
  282. self.PasteTextBtn.TextXAlignment = Enum.TextXAlignment.Left
  283. self.PasteTextBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  284. self.PasteTextBtn.BackgroundTransparency = 1
  285. self.PasteTextBtn.BorderColor = BrickColor.new("Really black")
  286. self.PasteTextBtn.BorderColor3 = Color3.fromRGB(0, 0, 0)
  287. self.PasteTextBtn.BorderSizePixel = 0
  288. self.PasteTextBtn.Interactable = false
  289. self.PasteTextBtn.Position = UDim2.new(0.34, 0, 0.27, 0)
  290. self.PasteTextBtn.Size = UDim2.new(0.45, 0, 0.45, 0)
  291.  
  292. local UICorner_6 = Instance.new("UICorner")
  293. UICorner_6.CornerRadius = UDim.new(0.3, 0)
  294.  
  295. local UIGradient_5 = Instance.new("UIGradient")
  296. UIGradient_5.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
  297. UIGradient_5.Rotation = -95
  298.  
  299. local UIStroke_4 = Instance.new("UIStroke")
  300. UIStroke_4.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  301. UIStroke_4.BorderStrokePosition = Enum.BorderStrokePosition.Inner
  302. UIStroke_4.Color = Color3.fromRGB(255, 255, 255)
  303. UIStroke_4.Transparency = 0.94
  304.  
  305. local UIGradient_6 = Instance.new("UIGradient")
  306. UIGradient_6.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  307. UIGradient_6.Rotation = 87
  308.  
  309. self.ImageLabel_4 = Instance.new("ImageLabel")
  310. self.ImageLabel_4.Image = "rbxassetid://138891916339154"
  311. self.ImageLabel_4.ImageTransparency = 0.2
  312. self.ImageLabel_4.AnchorPoint = Vector2.new(0, 0.5)
  313. self.ImageLabel_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  314. self.ImageLabel_4.BackgroundTransparency = 1
  315. self.ImageLabel_4.BorderColor = BrickColor.new("Really black")
  316. self.ImageLabel_4.BorderColor3 = Color3.fromRGB(0, 0, 0)
  317. self.ImageLabel_4.BorderSizePixel = 0
  318. self.ImageLabel_4.Position = UDim2.new(0.1, 0, 0.5, 0)
  319. self.ImageLabel_4.Size = UDim2.new(0.5, 0, 0.5, 0)
  320. self.ImageLabel_4.SizeConstraint = Enum.SizeConstraint.RelativeYY
  321.  
  322. self.get = Instance.new("TextButton")
  323. self.get.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
  324. self.get.Text = ""
  325. self.get.TextColor = BrickColor.new("Really black")
  326. self.get.TextColor3 = Color3.fromRGB(0, 0, 0)
  327. self.get.TextSize = 14
  328. self.get.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  329. self.get.BackgroundTransparency = 0.9
  330. self.get.BorderColor = BrickColor.new("Really black")
  331. self.get.BorderColor3 = Color3.fromRGB(0, 0, 0)
  332. self.get.BorderSizePixel = 0
  333. self.get.Position = UDim2.new(0.74, 0, 0.62, 0)
  334. self.get.Size = UDim2.new(0.21, 0, 0.18, 0)
  335. self.get.Name = "get"
  336.  
  337. self.GetTextBtn = Instance.new("TextButton")
  338. self.GetTextBtn.FontFace = Font.new("rbxassetid://12187373327", Enum.FontWeight.ExtraBold, Enum.FontStyle.Normal)
  339. self.GetTextBtn.Text = t.getKeyLabel
  340. self.GetTextBtn.TextColor = BrickColor.new("Institutional white")
  341. self.GetTextBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  342. self.GetTextBtn.TextScaled = true
  343. self.GetTextBtn.TextSize = 14
  344. self.GetTextBtn.TextWrapped = true
  345. self.GetTextBtn.TextXAlignment = Enum.TextXAlignment.Left
  346. self.GetTextBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  347. self.GetTextBtn.BackgroundTransparency = 1
  348. self.GetTextBtn.BorderColor = BrickColor.new("Really black")
  349. self.GetTextBtn.BorderColor3 = Color3.fromRGB(0, 0, 0)
  350. self.GetTextBtn.BorderSizePixel = 0
  351. self.GetTextBtn.Interactable = false
  352. self.GetTextBtn.Position = UDim2.new(0.34, 0, 0.27, 0)
  353. self.GetTextBtn.Size = UDim2.new(0.66, 0, 0.45, 0)
  354.  
  355. local UICorner_7 = Instance.new("UICorner")
  356. UICorner_7.CornerRadius = UDim.new(0.3, 0)
  357.  
  358. local UIGradient_7 = Instance.new("UIGradient")
  359. UIGradient_7.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
  360. UIGradient_7.Rotation = -95
  361.  
  362. local UIStroke_5 = Instance.new("UIStroke")
  363. UIStroke_5.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  364. UIStroke_5.BorderStrokePosition = Enum.BorderStrokePosition.Inner
  365. UIStroke_5.Color = Color3.fromRGB(255, 255, 255)
  366. UIStroke_5.Transparency = 0.94
  367.  
  368. local UIGradient_8 = Instance.new("UIGradient")
  369. UIGradient_8.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  370. UIGradient_8.Rotation = 87
  371.  
  372. local ImageLabel_5 = Instance.new("ImageLabel")
  373. ImageLabel_5.Image = "rbxassetid://136880030971951"
  374. ImageLabel_5.ImageTransparency = 0.2
  375. ImageLabel_5.ScaleType = Enum.ScaleType.Fit
  376. ImageLabel_5.AnchorPoint = Vector2.new(0, 0.5)
  377. ImageLabel_5.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  378. ImageLabel_5.BackgroundTransparency = 1
  379. ImageLabel_5.BorderColor = BrickColor.new("Really black")
  380. ImageLabel_5.BorderColor3 = Color3.fromRGB(0, 0, 0)
  381. ImageLabel_5.BorderSizePixel = 0
  382. ImageLabel_5.Position = UDim2.new(0.1, 0, 0.5, 0)
  383. ImageLabel_5.Size = UDim2.new(0.55, 0, 0.55, 0)
  384. ImageLabel_5.SizeConstraint = Enum.SizeConstraint.RelativeYY
  385.  
  386. self.enter = Instance.new("TextButton")
  387. self.enter.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
  388. self.enter.Text = ""
  389. self.enter.TextColor = BrickColor.new("Really black")
  390. self.enter.TextColor3 = Color3.fromRGB(0, 0, 0)
  391. self.enter.TextSize = 14
  392. self.enter.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  393. self.enter.BackgroundTransparency = 0.9
  394. self.enter.BorderColor = BrickColor.new("Really black")
  395. self.enter.BorderColor3 = Color3.fromRGB(0, 0, 0)
  396. self.enter.BorderSizePixel = 0
  397. self.enter.Position = UDim2.new(0.86, 0, 0.14, 0)
  398. self.enter.Size = UDim2.new(0.24, 0, 0.24, 0)
  399. self.enter.SizeConstraint = Enum.SizeConstraint.RelativeYY
  400. self.enter.Name = "enter"
  401.  
  402. local UICorner_8 = Instance.new("UICorner")
  403. UICorner_8.CornerRadius = UDim.new(0.3, 0)
  404.  
  405. local UIGradient_9 = Instance.new("UIGradient")
  406. UIGradient_9.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(149, 149, 149))})
  407. UIGradient_9.Rotation = -95
  408.  
  409. local UIStroke_6 = Instance.new("UIStroke")
  410. UIStroke_6.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  411. UIStroke_6.BorderStrokePosition = Enum.BorderStrokePosition.Inner
  412. UIStroke_6.Color = Color3.fromRGB(255, 255, 255)
  413. UIStroke_6.Transparency = 0.94
  414.  
  415. local UIGradient_10 = Instance.new("UIGradient")
  416. UIGradient_10.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  417. UIGradient_10.Rotation = 87
  418.  
  419. local ImageLabel_6 = Instance.new("ImageLabel")
  420. ImageLabel_6.Image = "rbxassetid://132729169219715"
  421. ImageLabel_6.ImageTransparency = 0.2
  422. ImageLabel_6.ScaleType = Enum.ScaleType.Fit
  423. ImageLabel_6.AnchorPoint = Vector2.new(0.5, 0.5)
  424. ImageLabel_6.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  425. ImageLabel_6.BackgroundTransparency = 1
  426. ImageLabel_6.BorderColor = BrickColor.new("Really black")
  427. ImageLabel_6.BorderColor3 = Color3.fromRGB(0, 0, 0)
  428. ImageLabel_6.BorderSizePixel = 0
  429. ImageLabel_6.Position = UDim2.new(0.5, 0, 0.5, 0)
  430. ImageLabel_6.Size = UDim2.new(0.4, 0, 0.4, 0)
  431. ImageLabel_6.SizeConstraint = Enum.SizeConstraint.RelativeYY
  432.  
  433. local ImageLabel_7 = Instance.new("ImageLabel")
  434. ImageLabel_7.Image = "rbxassetid://119320247722777"
  435. ImageLabel_7.ImageTransparency = 0.9
  436. ImageLabel_7.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  437. ImageLabel_7.BackgroundTransparency = 1
  438. ImageLabel_7.BorderColor = BrickColor.new("Really black")
  439. ImageLabel_7.BorderColor3 = Color3.fromRGB(0, 0, 0)
  440. ImageLabel_7.BorderSizePixel = 0
  441. ImageLabel_7.Size = UDim2.new(1, 0, 1, 0)
  442. ImageLabel_7.Visible = false
  443.  
  444. local UIStroke_7 = Instance.new("UIStroke")
  445. UIStroke_7.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  446. UIStroke_7.BorderStrokePosition = Enum.BorderStrokePosition.Inner
  447. UIStroke_7.Color = Color3.fromRGB(255, 255, 255)
  448. UIStroke_7.Transparency = 0.93
  449.  
  450. local UICorner_9 = Instance.new("UICorner")
  451. UICorner_9.CornerRadius = UDim.new(0.03, 0)
  452.  
  453. self.Key_System.Parent = gethui()
  454. self.Frame.Parent = self.Key_System
  455. bggradient.Parent = self.Frame
  456.  
  457. self.TextLabel.Parent = self.Frame
  458. self.TextLabel_2.Parent = self.Frame
  459. self.Frame_2.Parent = self.Frame
  460. UICorner_2.Parent = self.Frame_2
  461. ImageLabel.Parent = self.Frame_2
  462. UICorner_3.Parent = ImageLabel
  463. UIStroke.Parent = ImageLabel
  464. self.textboxtoggle.Parent = self.Frame_2
  465. UICorner_4.Parent = self.textboxtoggle
  466. UIStroke_2.Parent = self.textboxtoggle
  467. UIGradient.Parent = UIStroke_2
  468. UIGradient_2.Parent = self.textboxtoggle
  469. self.key.Parent = self.textboxtoggle
  470. ImageLabel_2.Parent = self.textboxtoggle
  471. self.exit.Parent = self.Frame_2
  472. UICorner_5.Parent = self.exit
  473. UIGradient_3.Parent = self.exit
  474. UIStroke_3.Parent = self.exit
  475. UIGradient_4.Parent = UIStroke_3
  476. ImageLabel_3.Parent = self.exit
  477. self.ExitTextBtn.Parent = self.exit
  478. self.paste.Parent = self.Frame_2
  479. self.PasteTextBtn.Parent = self.paste
  480. UICorner_6.Parent = self.paste
  481. UIGradient_5.Parent = self.paste
  482. UIStroke_4.Parent = self.paste
  483. UIGradient_6.Parent = UIStroke_4
  484. self.ImageLabel_4.Parent = self.paste
  485. self.get.Parent = self.Frame_2
  486. self.GetTextBtn.Parent = self.get
  487. UICorner_7.Parent = self.get
  488. UIGradient_7.Parent = self.get
  489. UIStroke_5.Parent = self.get
  490. UIGradient_8.Parent = UIStroke_5
  491. ImageLabel_5.Parent = self.get
  492. self.enter.Parent = self.Frame_2
  493. UICorner_8.Parent = self.enter
  494. UIGradient_9.Parent = self.enter
  495. UIStroke_6.Parent = self.enter
  496. UIGradient_10.Parent = UIStroke_6
  497. ImageLabel_6.Parent = self.enter
  498. ImageLabel_7.Parent = self.Frame
  499. UIStroke_7.Parent = ImageLabel_7
  500. UICorner_9.Parent = ImageLabel_7
  501.  
  502. self._il2 = ImageLabel_2
  503. self._il3 = ImageLabel_3
  504. self._il5 = ImageLabel_5
  505. self._il6 = ImageLabel_6
  506. end
  507.  
  508. function CubixKeySystem:_pressAnim(btn)
  509. local ox = btn.Size.X.Scale
  510. local oy = btn.Size.Y.Scale
  511. local op = btn.Position
  512. local nx = ox * 0.91
  513. local ny = oy * 0.91
  514. local npx = op.X.Scale + (ox - nx) / 2
  515. local npy = op.Y.Scale + (oy - ny) / 2
  516. local down = tw(btn, 0.09, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, {
  517. Size = UDim2.new(nx, 0, ny, 0),
  518. Position = UDim2.new(npx, 0, npy, 0),
  519. BackgroundTransparency = 0.75,
  520. })
  521. down:Play()
  522. down.Completed:Connect(function()
  523. tw(btn, 0.18, Enum.EasingStyle.Back, Enum.EasingDirection.Out, {
  524. Size = UDim2.new(ox, 0, oy, 0),
  525. Position = op,
  526. BackgroundTransparency = 0.9,
  527. }):Play()
  528. end)
  529. end
  530.  
  531. function CubixKeySystem:_playExit(cb)
  532. tw(self.TextLabel, 0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.In, { TextTransparency = 1 }):Play()
  533. tw(self.TextLabel_2, 0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.In, { TextTransparency = 1 }):Play()
  534. after(0.15, function()
  535. local panelOut = tw(self.Frame_2, 0.4, Enum.EasingStyle.Back, Enum.EasingDirection.In, {
  536. Position = UDim2.new(0.5, 0, 0.68, 0),
  537. BackgroundTransparency = 1,
  538. })
  539. panelOut:Play()
  540. panelOut.Completed:Connect(function()
  541. local bgOut = tw(self.Frame, 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.In, {
  542. BackgroundTransparency = 1,
  543. })
  544. bgOut:Play()
  545. bgOut.Completed:Connect(function()
  546. self.Key_System:Destroy()
  547. if cb then cb() end
  548. end)
  549. end)
  550. end)
  551. end
  552.  
  553. function CubixKeySystem:_playEntry()
  554. self.Frame.BackgroundTransparency = 1
  555. self.TextLabel.TextTransparency = 1
  556. self.TextLabel_2.TextTransparency = 1
  557. self.Frame_2.BackgroundTransparency = 1
  558. self.Frame_2.Position = UDim2.new(0.5, 0, 0.52, 0)
  559.  
  560. self.textboxtoggle.BackgroundTransparency = 1
  561. self.exit.BackgroundTransparency = 1
  562. self.paste.BackgroundTransparency = 1
  563. self.get.BackgroundTransparency = 1
  564. self.enter.BackgroundTransparency = 1
  565. self._il2.ImageTransparency = 1
  566. self._il3.ImageTransparency = 1
  567. self.ImageLabel_4.ImageTransparency = 1
  568. self._il5.ImageTransparency = 1
  569. self._il6.ImageTransparency = 1
  570. self.ExitTextBtn.TextTransparency = 1
  571. self.PasteTextBtn.TextTransparency = 1
  572. self.GetTextBtn.TextTransparency = 1
  573.  
  574. tw(self.Frame, 0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { BackgroundTransparency = 0 }):Play()
  575.  
  576. after(0.3, function()
  577. tw(self.TextLabel, 0.45, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
  578. end)
  579.  
  580. after(0.5, function()
  581. tw(self.TextLabel_2, 0.45, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
  582. end)
  583.  
  584. after(0.7, function()
  585. tw(self.Frame_2, 0.55, Enum.EasingStyle.Back, Enum.EasingDirection.Out, {
  586. Position = UDim2.new(0.5, 0, 0.37, 0),
  587. BackgroundTransparency = 0.7,
  588. }):Play()
  589. end)
  590.  
  591. after(0.95, function()
  592. tw(self.textboxtoggle, 0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { BackgroundTransparency = 0.92 }):Play()
  593. tw(self._il2, 0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
  594. end)
  595.  
  596. after(1.1, function()
  597. tw(self.enter, 0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { BackgroundTransparency = 0.9 }):Play()
  598. tw(self._il6, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
  599. end)
  600.  
  601. after(1.25, function()
  602. tw(self.exit, 0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { BackgroundTransparency = 0.9 }):Play()
  603. tw(self._il3, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
  604. tw(self.ExitTextBtn, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
  605. end)
  606.  
  607. after(1.4, function()
  608. tw(self.paste, 0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { BackgroundTransparency = 0.9 }):Play()
  609. tw(self.ImageLabel_4, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
  610. tw(self.PasteTextBtn, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
  611. end)
  612.  
  613. after(1.55, function()
  614. tw(self.get, 0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out, { BackgroundTransparency = 0.9 }):Play()
  615. tw(self._il5, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { ImageTransparency = 0.2 }):Play()
  616. tw(self.GetTextBtn, 0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, { TextTransparency = 0 }):Play()
  617. end)
  618. end
  619.  
  620. function CubixKeySystem:_connect()
  621. self.exit.MouseButton1Click:Connect(function()
  622. self:_pressAnim(self.exit)
  623. after(0.1, function()
  624. self:_playExit(function()
  625. self._callbacks.onExit()
  626. end)
  627. end)
  628. end)
  629.  
  630. self.paste.MouseButton1Click:Connect(function()
  631. self:_pressAnim(self.paste)
  632. after(0.1, function()
  633. pcall(function()
  634. local clip = getclipboard and getclipboard() or ""
  635. if #clip > 0 then self.key.Text = clip end
  636. end)
  637. end)
  638. end)
  639.  
  640. self.get.MouseButton1Click:Connect(function()
  641. self:_pressAnim(self.get)
  642. after(0.1, function()
  643. self._callbacks.onGetKey()
  644. end)
  645. end)
  646.  
  647. self.enter.MouseButton1Click:Connect(function()
  648. self:_pressAnim(self.enter)
  649. after(0.1, function()
  650. local input = self.key.Text
  651. if self._validKeys[input] then
  652. self:_playExit(function()
  653. self._callbacks.onCorrectKey(input)
  654. end)
  655. else
  656. local base = self.textboxtoggle.Position
  657. local offsets = {-0.04, 0.04, -0.03, 0.03, -0.02, 0.02, -0.01, 0.01, 0}
  658. local idx = 0
  659. local function step()
  660. idx = idx + 1
  661. if offsets[idx] then
  662. local s = tw(self.textboxtoggle, 0.04, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, {
  663. Position = UDim2.new(base.X.Scale + offsets[idx], 0, base.Y.Scale, 0),
  664. })
  665. s:Play()
  666. s.Completed:Connect(step)
  667. end
  668. end
  669. step()
  670. end
  671. end)
  672. end)
  673. end
  674.  
  675. return CubixKeySystem
  676.  
  677. --[[
  678. ========== EXAMPLE USAGE ==========
  679.  
  680. local KeySystem = loadstring(game:HttpGet("your_raw_link_here"))()
  681.  
  682. local ks = KeySystem.new({
  683. WelcomeText = "Welcome to",
  684. TitleText = "Rosava Hub",
  685. PlaceholderText = "ROSAVA-XXXXXXXXXXXX",
  686. ExitLabel = "Exit",
  687. PasteLabel = "Paste",
  688. GetKeyLabel = "Get Key",
  689.  
  690. ValidKeys = {
  691. ["ROSAVA-ABC123"] = true,
  692. ["ROSAVA-XYZ999"] = true,
  693. },
  694.  
  695. OnCorrectKey = function(key)
  696. print("Correct key entered:", key)
  697. end,
  698.  
  699. OnExit = function()
  700. print("User exited")
  701. end,
  702.  
  703. OnGetKey = function()
  704. if setclipboard then
  705. setclipboard("https://discord.gg/yourserver")
  706. end
  707. end,
  708. })
  709. ]]
Advertisement
Add Comment
Please, Sign In to add comment