· 3 years ago · Sep 20, 2022, 02:00 PM
1-- // Services
2local CoreGui = game:GetService('CoreGui')
3local TweenService = game:GetService('TweenService')
4local UserInputService = game:GetService('UserInputService')
5local TextService = game:GetService('TextService')
6local Players = game:GetService('Players')
7local Workspace = game:GetService('Workspace')
8local RunService = game:GetService('RunService')
9local Lighting = game:GetService('Lighting')
10
11-- // Variables
12local Library = {}
13local Utility = {}
14local Commands = {}
15local Config = {}
16local ConfigUpdates = {}
17local Dragging = false
18local BreakLoops = false
19local ChangeTheme = false
20
21-- // Utility Functions
22do
23 function Utility:Log(Type, Message)
24 Type = Type:lower()
25
26 if Type == 'error' then
27 error('[ Visual ] Error: ' .. Message)
28 elseif Type == 'log' then
29 print('[ Visual ] ' .. Message)
30 elseif Type == 'warn' then
31 warn('[ Visual ] Warning: ' .. Message)
32 end
33 end
34
35 function Utility:HasProperty(Instance, Property)
36 local Success = pcall(function()
37 return Instance[Property]
38 end)
39
40 return Success and not Instance:FindFirstChild(Property)
41 end
42
43 function Utility:Tween(Instance, Properties, Duration, ...)
44 local TweenInfo = TweenInfo.new(Duration, ...)
45 TweenService:Create(Instance, TweenInfo, Properties):Play()
46 end
47
48 function Utility:Create(InstanceName, Properties, Children)
49 local Object = Instance.new(InstanceName)
50 local Properties = Properties or {}
51 local Children = Children or {}
52
53 for Index, Property in next, Properties do
54 Object[Index] = Property
55 end
56
57 for _, Child in next, Children do
58 Child.Parent = Object
59 end
60
61 return Object
62 end
63
64 function Utility:Lighten(Color)
65 local H, S, V = Color:ToHSV()
66
67 V = math.clamp(V + 0.03, 0, 1)
68
69 return Color3.fromHSV(H, S, V)
70 end
71
72 function Utility:Darken(Color)
73 local H, S, V = Color:ToHSV()
74
75 V = math.clamp(V - 0.35, 0, 1)
76
77 return Color3.fromHSV(H, S, V)
78 end
79
80 function Utility:EnableDragging(Frame, Parent)
81 local DraggingInput, StartPosition
82 local DragStart = Vector3.new(0,0,0)
83
84 local Main = CoreGui:FindFirstChild('Visual Command UI Library | .gg/puxxCphTnK').Main
85
86 local function Update(Input)
87 local Delta = Input.Position - DragStart
88 local Camera = Workspace.CurrentCamera
89
90 if StartPosition.X.Offset + Delta.X <= -750 and -Camera.ViewportSize.X <= StartPosition.X.Offset + Delta.X then
91 local Position = UDim2.new(StartPosition.X.Scale, StartPosition.X.Offset + Delta.X, Parent.Position.Y.Scale, Parent.Position.Y.Offset)
92 Utility:Tween(Parent, {Position = Position}, 0.25)
93 elseif StartPosition.X.Offset + Delta.X > -500 then
94 local Position = UDim2.new(1, -250, Parent.Position.Y.Scale, Parent.Position.Y.Offset)
95 Utility:Tween(Parent, {Position = Position}, 0.25)
96 elseif -Camera.ViewportSize.X > StartPosition.X.Offset + Delta.X then
97 local Position = UDim2.new(1, -Camera.ViewportSize.X, Parent.Position.Y.Scale, Parent.Position.Y.Offset)
98 Utility:Tween(Parent, {Position = Position}, 0.25)
99 end
100 end
101
102 Frame.InputBegan:Connect(function(Input)
103 if Input.UserInputType == Enum.UserInputType.MouseButton1 then
104 Dragging = true
105 DragStart = Input.Position
106 StartPosition = Parent.Position
107
108 Input.Changed:Connect(function()
109 if Input.UserInputState == Enum.UserInputState.End then
110 Dragging = false
111 end
112 end)
113 end
114 end)
115
116 Frame.InputChanged:Connect(function(Input)
117 if Input.UserInputType == Enum.UserInputType.MouseMovement then
118 DraggingInput = Input
119 end
120 end)
121
122 UserInputService.InputChanged:Connect(function(Input)
123 if Input == DraggingInput and Dragging then
124 Update(Input)
125 end
126 end)
127 end
128
129 function Utility:StringToKeyCode(String)
130 local Byte = string.byte(String)
131
132 for _, KeyCode in next, Enum.KeyCode:GetEnumItems() do
133 if KeyCode.Value == Byte then
134 return KeyCode
135 end
136 end
137 end
138
139 function Utility:KeyCodeToString(KeyCode)
140 if KeyCode.Value < 127 and KeyCode.Value > 33 then
141 return string.char(KeyCode.Value)
142 else
143 return KeyCode.Name
144 end
145 end
146
147 function Utility:GetProperty(Level, Name, Properties)
148 local AllProperties = {
149 Window = {
150 Name = {
151 'Name',
152 'NAME',
153 'name'
154 },
155 IntroText = {
156 'IntroText',
157 'INTROTEXT',
158 'introText',
159 'introtext',
160 'Introtext'
161 },
162 IntroIcon = {
163 'IntroIcon',
164 'INTROICON',
165 'introIcon',
166 'introicon',
167 'Introicon'
168 },
169 IntroBlur = {
170 'IntroBlur',
171 'Introblur',
172 'INTROBLUR',
173 'introBlur',
174 'introblur',
175 },
176 IntroBlurIntensity = {
177 'introblurintensity',
178 'Introblurintensity',
179 'INTROBLURINTENSITY',
180 'introBlurintensity',
181 'IntroBlurintensity',
182 'introblurIntensity',
183 'IntroblurIntensity',
184 'introBlurIntensity',
185 'IntroBlurIntensity'
186 },
187 Theme = {
188 'Theme',
189 'THEME',
190 'theme'
191 },
192 Position = {
193 'Position',
194 'position',
195 'POSITION'
196 },
197 Draggable = {
198 'Draggable',
199 'DRAGGABLE',
200 'draggable'
201 },
202 Prefix = {
203 'Prefix',
204 'PREFIX',
205 'prefix'
206 }
207 }
208 }
209
210 local PossibleNames = AllProperties[Level][Name]
211
212 for _, Name in next, PossibleNames do
213 if Properties[Name] then
214 return Properties[Name]
215 end
216 end
217 end
218
219 function Utility:Destroy()
220 BreakAllLoops = true
221
222 for _, UI in next, CoreGui:GetChildren() do
223 if UI.Name == 'Visual Command UI Library | .gg/puxxCphTnK' then
224 for _, Item in next, UI.Main:GetChildren() do
225 if Item.Name ~= 'MainCorner' and Item.Name ~= 'MainStroke' then
226 Item:Destroy()
227 end
228 end
229
230 Utility:Tween(UI.Main, {Size = UDim2.new(0, 500, 0, 0)}, 0.25)
231 Utility:Tween(UI.ToolTip, {BackgroundTransparency = 1}, 0.25)
232
233 task.wait(0.25)
234
235 UI:Destroy()
236 end
237 end
238 end
239end
240
241-- // Library Defaults
242Library.Transparency = 0
243Library.Themes = {
244 ['dark'] = {
245 BackgroundColor = Color3.fromRGB(40, 40, 40),
246 SecondaryColor = Color3.fromRGB(50, 50, 50),
247 AccentColor = Color3.fromRGB(100, 100, 100),
248 PrimaryTextColor = Color3.fromRGB(255, 255, 255),
249 SecondaryTextColor = Color3.fromRGB(175, 175, 175)
250 },
251 ['light'] = {
252 BackgroundColor = Color3.fromRGB(255, 255, 255),
253 SecondaryColor = Color3.fromRGB(225, 225, 225),
254 AccentColor = Color3.fromRGB(125, 125, 125),
255 PrimaryTextColor = Color3.fromRGB(0, 0, 0),
256 SecondaryTextColor = Color3.fromRGB(75, 75, 75)
257 },
258 ['discord'] = {
259 BackgroundColor = Color3.fromRGB(54, 57, 63),
260 PrimaryTextColor = Color3.fromRGB(255, 255, 255),
261 SecondaryTextColor = Color3.fromRGB(110, 110, 115),
262 AccentColor = Color3.fromRGB(75, 75, 75),
263 SecondaryColor = Color3.fromRGB(59, 65, 72)
264 },
265 ['redandblack'] = {
266 BackgroundColor = Color3.fromRGB(0, 0, 0),
267 PrimaryTextColor = Color3.fromRGB(255, 255, 255),
268 SecondaryTextColor = Color3.fromRGB(135, 135, 135),
269 AccentColor = Color3.fromRGB(255, 0, 0),
270 SecondaryColor = Color3.fromRGB(50, 50, 50)
271 },
272 ['nordicdark'] = {
273 BackgroundColor = Color3.fromRGB(25, 30, 35),
274 PrimaryTextColor = Color3.fromRGB(255, 255, 255),
275 SecondaryTextColor = Color3.fromRGB(135, 135, 135),
276 AccentColor = Color3.fromRGB(50, 60, 70),
277 SecondaryColor = Color3.fromRGB(50, 55, 60)
278 },
279 ['nordiclight'] = {
280 BackgroundColor = Color3.fromRGB(67, 75, 94),
281 PrimaryTextColor = Color3.fromRGB(255, 255, 255),
282 SecondaryTextColor = Color3.fromRGB(135, 135, 135),
283 AccentColor = Color3.fromRGB(92, 97, 116),
284 SecondaryColor = Color3.fromRGB(82, 87, 106)
285 },
286 ['purple'] = {
287 BackgroundColor = Color3.fromRGB(30, 30, 45),
288 PrimaryTextColor = Color3.fromRGB(255, 255, 255),
289 SecondaryTextColor = Color3.fromRGB(135, 135, 135),
290 AccentColor = Color3.fromRGB(60, 60, 80),
291 SecondaryColor = Color3.fromRGB(60, 60, 80)
292 },
293 ['sentinel'] = {
294 BackgroundColor = Color3.fromRGB(30, 30, 30),
295 PrimaryTextColor = Color3.fromRGB(130, 190, 130),
296 SecondaryTextColor = Color3.fromRGB(230, 35, 70),
297 AccentColor = Color3.fromRGB(50, 50, 50),
298 SecondaryColor = Color3.fromRGB(35, 35, 35)
299 },
300 ['synapsex'] = {
301 BackgroundColor = Color3.fromRGB(50, 50, 50),
302 PrimaryTextColor = Color3.fromRGB(255, 255, 255),
303 SecondaryTextColor = Color3.fromRGB(125, 125, 125),
304 AccentColor = Color3.fromRGB(70, 70, 70),
305 SecondaryColor = Color3.fromRGB(65, 65, 65)
306 },
307 ['krnl'] = {
308 BackgroundColor = Color3.fromRGB(40, 40, 40),
309 PrimaryTextColor = Color3.fromRGB(255, 255, 255),
310 SecondaryTextColor = Color3.fromRGB(125, 125, 125),
311 AccentColor = Color3.fromRGB(60, 60, 60),
312 SecondaryColor = Color3.fromRGB(40, 40, 40)
313 },
314 ['scriptware'] = {
315 BackgroundColor = Color3.fromRGB(30, 30, 30),
316 PrimaryTextColor = Color3.fromRGB(0, 125, 255),
317 SecondaryTextColor = Color3.fromRGB(255, 255, 255),
318 AccentColor = Color3.fromRGB(0, 125, 255),
319 SecondaryColor = Color3.fromRGB(45, 45, 45)
320 },
321 ['kiriot'] = {
322 BackgroundColor = Color3.fromRGB(35, 35, 35),
323 PrimaryTextColor = Color3.fromRGB(255, 255, 255),
324 SecondaryTextColor = Color3.fromRGB(135, 135, 135),
325 AccentColor = Color3.fromRGB(255, 170, 60),
326 SecondaryColor = Color3.fromRGB(50, 50, 50)
327 }
328}
329Library.Prefix = Utility:StringToKeyCode(';')
330Library.Theme = nil
331
332-- // CreateWindow - Name, IntroText, IntroIcon, IntroBlur, IntroBlurIntensity, Theme, Position, Draggable, Prefix
333function Library:CreateWindow(Properties)
334 -- // Properties
335 local Name = Utility:GetProperty('Window', 'Name', Properties) or 'Visual Command UI Library'
336 local IntroText = Utility:GetProperty('Window', 'IntroText', Properties) or 'Visual Command UI Library'
337 local IntroIcon = Utility:GetProperty('Window', 'IntroIcon', Properties) or 'rbxassetid://10618644218'
338 local IntroBlur = Utility:GetProperty('Window', 'IntroBlur', Properties) or false
339 local IntroBlurIntensity = Utility:GetProperty('Window', 'IntroBlurIntensity', Properties) or 15
340 local Theme = Utility:GetProperty('Window', 'Theme', Properties) or Library.Themes.dark
341 local Position = string.lower(Utility:GetProperty('Window', 'Position', Properties)) or 'top'
342 local Draggable = Utility:GetProperty('Window', 'Draggable', Properties) or false
343 local Prefix = Utility:StringToKeyCode(Utility:GetProperty('Window', 'Prefix', Properties)) or Utility:StringToKeyCode(';')
344
345 -- // Set Library Properties
346 Library.Prefix = Prefix
347 Library.Theme = Theme
348
349 -- // Custom Theme
350 if type(Theme) == 'table' then
351 Library.Themes['custom'] = Theme
352 end
353
354 -- // Destroy Old UI
355 Utility:Destroy()
356
357 -- // Create Elements
358 local Container = Utility:Create('ScreenGui', {
359 Parent = CoreGui,
360 Name = 'Visual Command UI Library | .gg/puxxCphTnK',
361 ResetOnSpawn = false
362 }, {
363 Utility:Create('Frame', {
364 Name = 'Main',
365 BackgroundColor3 = Theme.BackgroundColor,
366 BorderSizePixel = 0,
367 BackgroundTransparency = 0,
368 AnchorPoint = Vector2.new(0.5, 0.5),
369 Position = UDim2.new(0.5, 0, 0.5, 0),
370 Size = UDim2.new(0, 0, 0, 0)
371 }, {
372 Utility:Create('UIStroke', {
373 Name = 'MainStroke',
374 ApplyStrokeMode = 'Contextual',
375 Color = Theme.AccentColor,
376 LineJoinMode = 'Round',
377 Thickness = 1
378 }),
379 Utility:Create('UICorner', {
380 CornerRadius = UDim.new(0, 5),
381 Name = 'MainCorner'
382 }),
383 Utility:Create('TextLabel', {
384 Name = 'IntroText',
385 BackgroundColor3 = Theme.BackgroundColor,
386 BackgroundTransparency = 1,
387 TextTransparency = 1,
388 AnchorPoint = Vector2.new(0.5, 0.5),
389 Position = UDim2.new(0.5, 0, 0.5, -30),
390 BorderSizePixel = 0,
391 Size = UDim2.new(0, 170, 0, 20),
392 Font = Enum.Font.Gotham,
393 Text = IntroText,
394 TextColor3 = Theme.PrimaryTextColor,
395 TextSize = 18,
396 ZIndex = 2,
397 TextXAlignment = Enum.TextXAlignment.Center
398 }),
399 Utility:Create('ImageLabel', {
400 Name = 'IntroImage',
401 BackgroundColor3 = Theme.BackgroundColor,
402 BackgroundTransparency = 1,
403 ImageTransparency = 1,
404 BorderSizePixel = 0,
405 AnchorPoint = Vector2.new(0.5, 0.5),
406 Position = UDim2.new(0.5, 0, 0.5, 20),
407 ZIndex = 3,
408 Size = UDim2.new(0, 80, 0, 80),
409 Image = IntroIcon,
410 ScaleType = Enum.ScaleType.Fit
411 })
412 }),
413 })
414
415 -- // Intro Blur
416
417 -- // Variables
418 local Main = Container.Main
419 local MainStroke = Main.MainStroke
420
421 -- // Dragging
422 if Draggable then
423 Utility:EnableDragging(Main, Main)
424 end
425
426 -- // Intro
427 MainStroke.Thickness = 0
428
429 if IntroBlur == true then
430 Utility:Create('BlurEffect', {
431 Name = 'VisualIntroBlur',
432 Parent = Lighting,
433 Size = 0
434 })
435
436 local Blur = Lighting.VisualIntroBlur
437
438 Utility:Tween(Blur, {Size = IntroBlurIntensity}, 1)
439
440 task.wait(1)
441 end
442
443 Utility:Tween(Main, {BackgroundTransparency = 1}, 0)
444
445 Utility:Tween(Main, {Size = UDim2.new(0, 1000, 0, 500)}, 0.25)
446
447 task.wait(0.5)
448
449 Utility:Tween(Main['IntroText'], {TextTransparency = 0}, 0.25)
450
451 task.wait(0.5)
452
453 Utility:Tween(Main['IntroImage'], {ImageTransparency = 0}, 0.25)
454
455 task.wait(3)
456
457 Utility:Tween(Main['IntroText'], {TextTransparency = 1}, 0.25)
458
459 task.wait(0.5)
460
461 Utility:Tween(Main['IntroImage'], {ImageTransparency = 1}, 0.25)
462
463 task.wait(0.5)
464
465 if IntroBlur == true then
466 Utility:Tween(Lighting.VisualIntroBlur, {Size = 0}, 1)
467
468 task.wait(1)
469 end
470
471 Main['IntroText']:Destroy()
472 Main['IntroImage']:Destroy()
473
474 if IntroBlur == true then
475 Lighting.VisualIntroBlur:Destroy()
476 end
477
478 Utility:Tween(Main, {Size = UDim2.new(0, 500, 0, 65)}, 0.25)
479 Utility:Tween(Main, {BackgroundTransparency = 0}, 0.25)
480 MainStroke.Thickness = 1
481
482 task.wait(0.5)
483
484 -- // Position
485 if Position == 'top' then
486 Main.AnchorPoint = Vector2.new(0.5, 0)
487 Utility:Tween(Main, {Position = UDim2.new(0.5, 0, 0, -72)}, 0.25)
488 elseif Position == 'topleft' then
489 Main.AnchorPoint = Vector2.new(0, 0)
490 Utility:Tween(Main, {Position = UDim2.new(0, 0, 0, -72)}, 0.25)
491 elseif Position == 'topright' then
492 Main.AnchorPoint = Vector2.new(1, 0)
493 Utility:Tween(Main, {Position = UDim2.new(1, 0, 0, -72)}, 0.25)
494 elseif Position == 'bottomleft' then
495 Main.AnchorPoint = Vector2.new(0, 1)
496 Utility:Tween(Main, {Position = UDim2.new(0, 0, 1, 36)}, 0.25)
497 elseif Position == 'bottom' then
498 Main.AnchorPoint = Vector2.new(0.5, 1)
499 Utility:Tween(Main, {Position = UDim2.new(0.5, 0, 1, 36)}, 0.25)
500 elseif Position == 'bottomright' then
501 Main.AnchorPoint = Vector2.new(1, 1)
502 Utility:Tween(Main, {Position = UDim2.new(1, 0, 1, 36)}, 0.25)
503 end
504
505 -- // Fillers And Lines
506 if string.find(Position, 'top') then
507 Utility:Create('Frame', {
508 Parent = Main,
509 BackgroundColor3 = Theme.BackgroundColor,
510 BorderSizePixel = 0,
511 Name = 'Filler1',
512 BackgroundTransparency = 0,
513 Position = UDim2.new(0, 0, 0, 0),
514 Size = UDim2.new(0, 5, 0, 5)
515 })
516 Utility:Create('Frame', {
517 Parent = Main,
518 BackgroundColor3 = Theme.BackgroundColor,
519 BorderSizePixel = 0,
520 Name = 'Filler2',
521 BackgroundTransparency = 0,
522 Position = UDim2.new(0, 495, 0, 0),
523 Size = UDim2.new(0, 5, 0, 5)
524 })
525 Utility:Create('Frame', {
526 Parent = Main,
527 BackgroundColor3 = Theme.AccentColor,
528 BorderSizePixel = 0,
529 Name = 'Line1',
530 BackgroundTransparency = 0,
531 Position = UDim2.new(0, -1, 0, 0),
532 Size = UDim2.new(0, 1, 0, 10)
533 })
534 Utility:Create('Frame', {
535 Parent = Main,
536 BackgroundColor3 = Theme.AccentColor,
537 BorderSizePixel = 0,
538 Name = 'Line2',
539 BackgroundTransparency = 0,
540 Position = UDim2.new(0, 500, 0, 0),
541 Size = UDim2.new(0, 1, 0, 10)
542 })
543 else
544 Utility:Create('Frame', {
545 Parent = Main,
546 BackgroundColor3 = Theme.BackgroundColor,
547 BorderSizePixel = 0,
548 BackgroundTransparency = 0,
549 Name = 'Filler1',
550 Position = UDim2.new(0, 0, 0, 60),
551 Size = UDim2.new(0, 5, 0, 5)
552 })
553 Utility:Create('Frame', {
554 Parent = Main,
555 BackgroundColor3 = Theme.BackgroundColor,
556 BorderSizePixel = 0,
557 BackgroundTransparency = 0,
558 Name = 'Filler2',
559 Position = UDim2.new(0, 495, 0, 60),
560 Size = UDim2.new(0, 5, 0, 5)
561 })
562 Utility:Create('Frame', {
563 Parent = Main,
564 BackgroundColor3 = Theme.AccentColor,
565 BorderSizePixel = 0,
566 BackgroundTransparency = 0,
567 Name = 'Line1',
568 Position = UDim2.new(0, -1, 0, 60),
569 Size = UDim2.new(0, 1, 0, 10)
570 })
571 Utility:Create('Frame', {
572 Parent = Main,
573 BackgroundColor3 = Theme.AccentColor,
574 BorderSizePixel = 0,
575 BackgroundTransparency = 0,
576 Name = 'Line2',
577 Position = UDim2.new(0, 500, 0, 60),
578 Size = UDim2.new(0, 1, 0, 10)
579 })
580 end
581
582 -- // Main Elements
583 if string.find(Position, 'bottom') then
584 Utility:Create('TextBox', {
585 Font = Enum.Font.Gotham,
586 PlaceholderColor3 = Theme.SecondaryTextColor,
587 PlaceholderText = 'Enter Command',
588 Text = '',
589 TextColor3 = Theme.PrimaryTextColor,
590 TextSize = 14,
591 ClearTextOnFocus = false,
592 Parent = Main,
593 BackgroundColor3 = Theme.SecondaryColor,
594 BorderSizePixel = 0,
595 TextTransparency = 0,
596 BackgroundTransparency = 1,
597 TextXAlignment = Enum.TextXAlignment.Left,
598 Visible = false,
599 Name = 'CommandInput',
600 AnchorPoint = Vector2.new(0.5, 1),
601 Position = UDim2.new(0.5, 0, 1, -5),
602 Size = UDim2.new(0, 490, 0, 30)
603 }, {
604 Utility:Create('UIStroke', {
605 Name = 'CommandInputStroke',
606 ApplyStrokeMode = 'Border',
607 Color = Theme.AccentColor,
608 LineJoinMode = 'Round',
609 Thickness = 0
610 }),
611 Utility:Create('UICorner', {
612 CornerRadius = UDim.new(0, 5),
613 Name = 'CommandInputCorner'
614 }),
615 Utility:Create('UIPadding', {
616 PaddingLeft = UDim.new(0, 5),
617 Name = 'CommandInputPadding'
618 }),
619 })
620
621 Utility:Create('TextLabel', {
622 Name = 'Title',
623 Parent = Main,
624 BackgroundColor3 = Theme.BackgroundColor,
625 BackgroundTransparency = 1,
626 TextTransparency = 1,
627 Position = UDim2.new(0, 0, 0, 4),
628 Size = UDim2.new(0, 250, 0, 20),
629 Font = Enum.Font.Gotham,
630 BorderSizePixel = 0,
631 Text = Name,
632 TextColor3 = Theme.PrimaryTextColor,
633 TextSize = 16,
634 TextXAlignment = Enum.TextXAlignment.Left
635 }, {
636 Utility:Create('UIPadding', {
637 Name = 'TitlePadding',
638 PaddingLeft = UDim.new(0, 7)
639 })
640 })
641
642 Utility:Create('TextButton', {
643 Name = 'CloseButton',
644 Position = UDim2.new(0, 475, 0, 4),
645 Size = UDim2.new(0, 20, 0, 20),
646 BackgroundColor3 = Theme.BackgroundColor,
647 TextColor3 = Theme.PrimaryTextColor,
648 AutoButtonColor = false,
649 Font = Enum.Font.Gotham,
650 Parent = Main,
651 TextYAlignment = Enum.TextYAlignment.Center,
652 BorderSizePixel = 0,
653 TextSize = 30,
654 Text = '×'
655 }, {
656 Utility:Create('UICorner', {
657 Name = 'CloseButtonCorner',
658 CornerRadius = UDim.new(0, 5)
659 })
660 })
661
662 Utility:Create('Frame', {
663 Parent = Main,
664 BackgroundColor3 = Theme.BackgroundColor,
665 BorderSizePixel = 0,
666 BackgroundTransparency = 0.5,
667 Name = 'CommandsHolder',
668 Visible = false,
669 Position = UDim2.new(0, 0, 0, -305),
670 Size = UDim2.new(0, 500, 0, 300)
671 }, {
672 Utility:Create('UIStroke', {
673 Name = 'CommandsHolderStroke',
674 ApplyStrokeMode = 'Contextual',
675 Color = Theme.AccentColor,
676 LineJoinMode = 'Round',
677 Thickness = 1
678 }),
679 Utility:Create('UICorner', {
680 CornerRadius = UDim.new(0, 5),
681 Name = 'CommandsHolderCorner'
682 }),
683 Utility:Create('ScrollingFrame', {
684 BackgroundColor3 = Theme.BackgroundColor,
685 BorderSizePixel = 0,
686 BackgroundTransparency = 1,
687 ScrollBarThickness = 1,
688 ScrollBarImageColor3 = Theme.AccentColor,
689 Name = 'CommandsHolderScrolling',
690 Position = UDim2.new(0, 0, 0, 5),
691 Size = UDim2.new(0, 500, 0, 290)
692 }, {
693 Utility:Create('UIListLayout', {
694 Name = 'CommandsHolderScrollingListLayout',
695 HorizontalAlignment = Enum.HorizontalAlignment.Center,
696 SortOrder = Enum.SortOrder.LayoutOrder,
697 Padding = UDim.new(0, 3)
698 })
699 })
700 })
701 else
702 Utility:Create('TextBox', {
703 Font = Enum.Font.Gotham,
704 PlaceholderColor3 = Theme.SecondaryTextColor,
705 PlaceholderText = 'Enter Command',
706 Text = '',
707 TextColor3 = Theme.PrimaryTextColor,
708 TextSize = 14,
709 Parent = Main,
710 BackgroundColor3 = Theme.SecondaryColor,
711 BorderSizePixel = 0,
712 TextTransparency = 0,
713 BackgroundTransparency = 1,
714 TextXAlignment = Enum.TextXAlignment.Left,
715 Visible = false,
716 Name = 'CommandInput',
717 AnchorPoint = Vector2.new(0.5, 0),
718 Position = UDim2.new(0.5, 0, 0, 5),
719 Size = UDim2.new(0, 490, 0, 30)
720 }, {
721 Utility:Create('UIStroke', {
722 Name = 'CommandInputStroke',
723 ApplyStrokeMode = 'Border',
724 Color = Theme.AccentColor,
725 LineJoinMode = 'Round',
726 Thickness = 0
727 }),
728 Utility:Create('UICorner', {
729 CornerRadius = UDim.new(0, 5),
730 Name = 'CommandInputCorner'
731 }),
732 Utility:Create('UIPadding', {
733 PaddingLeft = UDim.new(0, 5),
734 Name = 'CommandInputPadding'
735 }),
736 })
737
738 Utility:Create('TextLabel', {
739 Name = 'Title',
740 Parent = Main,
741 BackgroundColor3 = Theme.BackgroundColor,
742 BackgroundTransparency = 1,
743 TextTransparency = 1,
744 Position = UDim2.new(0, 0, 0, 40),
745 Size = UDim2.new(0, 250, 0, 20),
746 Font = Enum.Font.Gotham,
747 BorderSizePixel = 0,
748 Text = Name,
749 TextColor3 = Theme.PrimaryTextColor,
750 TextSize = 16,
751 TextXAlignment = Enum.TextXAlignment.Left
752 }, {
753 Utility:Create('UIPadding', {
754 Name = 'TitlePadding',
755 PaddingLeft = UDim.new(0, 7)
756 })
757 })
758
759 Utility:Create('TextButton', {
760 Name = 'CloseButton',
761 Position = UDim2.new(0, 475, 0, 40),
762 Size = UDim2.new(0, 20, 0, 20),
763 BackgroundColor3 = Theme.BackgroundColor,
764 TextColor3 = Theme.PrimaryTextColor,
765 AutoButtonColor = false,
766 Font = Enum.Font.Gotham,
767 Parent = Main,
768 TextYAlignment = Enum.TextYAlignment.Center,
769 BorderSizePixel = 0,
770 TextSize = 30,
771 Text = '×'
772 }, {
773 Utility:Create('UICorner', {
774 Name = 'CloseButtonCorner',
775 CornerRadius = UDim.new(0, 5)
776 }),
777 })
778
779 Utility:Create('Frame', {
780 Parent = Main,
781 BackgroundColor3 = Theme.BackgroundColor,
782 BorderSizePixel = 0,
783 Visible = false,
784 BackgroundTransparency = 1,
785 Name = 'CommandsHolder',
786 Position = UDim2.new(0, 0, 0, 70),
787 Size = UDim2.new(0, 500, 0, 300)
788 }, {
789 Utility:Create('UIStroke', {
790 Name = 'CommandsHolderStroke',
791 ApplyStrokeMode = 'Contextual',
792 Color = Theme.AccentColor,
793 LineJoinMode = 'Round',
794 Thickness = 1
795 }),
796 Utility:Create('UICorner', {
797 CornerRadius = UDim.new(0, 5),
798 Name = 'CommandsHolderCorner'
799 }),
800 Utility:Create('ScrollingFrame', {
801 BackgroundColor3 = Theme.BackgroundColor,
802 BorderSizePixel = 0,
803 BackgroundTransparency = 1,
804 ScrollBarThickness = 1,
805 ScrollBarImageColor3 = Theme.AccentColor,
806 Name = 'CommandsHolderScrolling',
807 Position = UDim2.new(0, 0, 0, 5),
808 Size = UDim2.new(0, 500, 0, 290)
809 }, {
810 Utility:Create('UIListLayout', {
811 Name = 'CommandsHolderScrollingListLayout',
812 HorizontalAlignment = Enum.HorizontalAlignment.Center,
813 SortOrder = Enum.SortOrder.LayoutOrder,
814 Padding = UDim.new(0, 3)
815 })
816 })
817 })
818 end
819
820 Utility:Create('TextLabel', {
821 Name = 'ToolTip',
822 Parent = Container,
823 BackgroundColor3 = Theme.BackgroundColor,
824 BackgroundTransparency = 0,
825 TextTransparency = 0,
826 Position = UDim2.new(0, 0, 0, 0),
827 Size = UDim2.new(0, 0, 0, 0),
828 AnchorPoint = Vector2.new(0.5, 0),
829 TextXAlignment = Enum.TextXAlignment.Left,
830 TextYAlignment = Enum.TextYAlignment.Top,
831 TextWrapped = true,
832 RichText = true,
833 ZIndex = 100,
834 Text = '',
835 Font = Enum.Font.Gotham,
836 BorderSizePixel = 0,
837 TextColor3 = Theme.PrimaryTextColor,
838 TextSize = 15
839 }, {
840 Utility:Create('UICorner', {
841 Name = 'ToolTipCorner',
842 CornerRadius = UDim.new(0, 5)
843 }),
844 Utility:Create('UIPadding', {
845 Name = 'ToolTipPadding',
846 PaddingLeft = UDim.new(0, 3),
847 PaddingTop = UDim.new(0, 3)
848 }),
849 Utility:Create('UIStroke', {
850 Name = 'ToolTipStroke',
851 ApplyStrokeMode = 'Border',
852 Color = Theme.AccentColor,
853 LineJoinMode = 'Round',
854 Thickness = 1
855 })
856 })
857
858 -- // Theme Update
859 task.spawn(function()
860 while task.wait() do
861 if ChangeTheme then
862 if not BreakLoops then
863 Utility:Tween(Main, {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
864 Utility:Tween(Main.MainStroke, {Color = Library.Theme.AccentColor}, 0.25)
865 Utility:Tween(Main.Filler1, {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
866 Utility:Tween(Main.Filler2, {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
867 Utility:Tween(Main.Line1, {BackgroundColor3 = Library.Theme.AccentColor}, 0.25)
868 Utility:Tween(Main.Line2, {BackgroundColor3 = Library.Theme.AccentColor}, 0.25)
869 Utility:Tween(Main.CommandInput, {BackgroundColor3 = Library.Theme.SecondaryColor}, 0.25)
870 Utility:Tween(Main.CommandInput, {TextColor3 = Library.Theme.PrimaryTextColor}, 0.25)
871 Utility:Tween(Main.CommandInput, {PlaceholderColor3 = Library.Theme.SecondaryTextColor}, 0.25)
872 Utility:Tween(Main.CommandInput.CommandInputStroke, {Color = Library.Theme.AccentColor}, 0.25)
873 Utility:Tween(Main.Title, {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
874 Utility:Tween(Main.Title, {TextColor3 = Library.Theme.PrimaryTextColor}, 0.25)
875 Utility:Tween(Main.CloseButton, {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
876 Utility:Tween(Main.CloseButton, {TextColor3 = Library.Theme.PrimaryTextColor}, 0.25)
877 Utility:Tween(Main.CommandsHolder, {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
878 Utility:Tween(Main.CommandsHolder.CommandsHolderScrolling, {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
879 Utility:Tween(Main.CommandsHolder.CommandsHolderScrolling, {ScrollBarImageColor3 = Library.Theme.AccentColor}, 0.25)
880 Utility:Tween(Main.CommandsHolder.CommandsHolderStroke, {Color = Theme.AccentColor}, 0.25)
881 Utility:Tween(Container.ToolTip, {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
882 Utility:Tween(Container.ToolTip, {TextColor3 = Library.Theme.PrimaryTextColor}, 0.25)
883 Utility:Tween(Container.ToolTip.ToolTipStroke, {Color = Theme.AccentColor}, 0.25)
884 else
885 break
886 end
887 end
888 end
889 end)
890
891 -- // Animate Elements
892 task.wait(0.25)
893
894 local CommandInput = Main.CommandInput
895 local CommandInputStroke = CommandInput.CommandInputStroke
896 local CloseButton = Main.CloseButton
897 local CommandsHolder = Main.CommandsHolder
898 local CommandsHolderScrolling = CommandsHolder.CommandsHolderScrolling
899 local CommandsHolderScrollingListLayout = CommandsHolderScrolling.CommandsHolderScrollingListLayout
900
901 for _, Element in next, Main:GetChildren() do
902 if Element:IsA('TextBox') or Element:IsA('TextLabel') or Element:IsA('TextButton') or Element:IsA('ImageButton') then
903 Element.Visible = true
904
905 if Utility:HasProperty(Element, 'BackgroundTransparency') then
906 Utility:Tween(Element, {BackgroundTransparency = 0}, 0.25)
907 end
908
909 if Utility:HasProperty(Element, 'TextTransparency') then
910 Utility:Tween(Element, {TextTransparency = 0}, 0.25)
911 end
912
913 if Utility:HasProperty(Element, 'ImageTransparency') then
914 Utility:Tween(Element, {ImageTransparency = 0}, 0.25)
915 end
916 end
917 end
918
919 CommandInputStroke.Thickness = 1
920
921 CloseButton.MouseEnter:Connect(function()
922 Utility:Tween(CloseButton, {TextColor3 = Utility:Darken(Theme.PrimaryTextColor)}, 0.25)
923 end)
924
925 CloseButton.MouseLeave:Connect(function()
926 Utility:Tween(CloseButton, {TextColor3 = Theme.PrimaryTextColor}, 0.25)
927 end)
928
929 -- // Update Command Holder Sizes
930 local function UpdateFrameSizes()
931 local Count = 0
932
933 for _, Instance in next, CommandsHolderScrolling:GetChildren() do
934 if not Instance:IsA('UIListLayout') and Instance.Visible then
935 Count += 1
936 end
937 end
938
939 local Size = Count * 30
940 local Padding = 3 * Count
941
942 Size += Padding - 3
943
944 if Count == 0 then
945 Utility:Tween(CommandsHolder, {Size = UDim2.new(0, 500, 0, 0)}, 0.25)
946 Utility:Tween(CommandsHolderScrolling, {Size = UDim2.new(0, 500, 0, Size)}, 0.25)
947 Utility:Tween(CommandsHolderScrolling, {CanvasSize = UDim2.new(0, 500, 0, Size)}, 0.25)
948
949 elseif Count < 9 then
950 Utility:Tween(CommandsHolder, {Size = UDim2.new(0, 500, 0, Size + 10)}, 0.25)
951 Utility:Tween(CommandsHolderScrolling, {Size = UDim2.new(0, 500, 0, Size)}, 0.25)
952 Utility:Tween(CommandsHolderScrolling, {CanvasSize = UDim2.new(0, 500, 0, Size)}, 0.25)
953
954 if string.find(Position, 'bottom') then
955 if Main.Position.Y == UDim.new(1, 1) or Main.Position.Y == UDim.new(1, 0) or Main.Position.Y == UDim.new(1, 2) or Main.Position.Y == UDim.new(0, -37) then
956 Utility:Tween(CommandsHolder, {Position = UDim2.new(0, 0, 0, -Main.Position.Y.Offset - Size - 13)}, 0.25)
957 else
958 Utility:Tween(CommandsHolder, {Position = UDim2.new(0, 0, 0, -Main.Position.Y.Offset - Size + 22)}, 0.25)
959 end
960 else
961 if Main.Position.Y == UDim.new(1, 36) or Main.Position.Y == UDim.new(0, -72) then
962 Utility:Tween(CommandsHolder, {Position = UDim2.new(0, 0, 0, -Main.Position.Y.Offset - 3)}, 0.25)
963 else
964 Utility:Tween(CommandsHolder, {Position = UDim2.new(0, 0, 0, -Main.Position.Y.Offset + 33)}, 0.25)
965 end
966 end
967 else
968 Utility:Tween(CommandsHolder, {Size = UDim2.new(0, 500, 0, 270)}, 0.25)
969 Utility:Tween(CommandsHolderScrolling, {Size = UDim2.new(0, 500, 0, 260)}, 0.25)
970 Utility:Tween(CommandsHolderScrolling, {CanvasSize = UDim2.new(0, 500, 0, Size)}, 0.25)
971
972 if string.find(Position, 'bottom') then
973 if Main.Position.Y == UDim.new(1, 1) or Main.Position.Y == UDim.new(1, 0) or Main.Position.Y == UDim.new(1, 2) or Main.Position.Y == UDim.new(0, -37) then
974 Utility:Tween(CommandsHolder, {Position = UDim2.new(0, 0, 0, -Main.Position.Y.Offset - 273)}, 0.25)
975 else
976 Utility:Tween(CommandsHolder, {Position = UDim2.new(0, 0, 0, -Main.Position.Y.Offset - 237)}, 0.25)
977 end
978 else
979 if Main.Position.Y == UDim.new(1, 36) or Main.Position.Y == UDim.new(0, -72) then
980 Utility:Tween(CommandsHolder, {Position = UDim2.new(0, 0, 0, -Main.Position.Y.Offset - 3)}, 0.25)
981 else
982 Utility:Tween(CommandsHolder, {Position = UDim2.new(0, 0, 0, -Main.Position.Y.Offset + 33)}, 0.25)
983 end
984 end
985 end
986 end
987
988 CommandsHolderScrolling.ChildAdded:Connect(UpdateFrameSizes)
989 CommandsHolderScrolling.ChildRemoved:Connect(UpdateFrameSizes)
990
991 -- // Main Button Callbacks
992 CloseButton.MouseButton1Down:Connect(function()
993 Utility:Tween(CloseButton, {TextColor3 = Utility:Darken(Theme.PrimaryTextColor)}, 0.25)
994
995 task.wait(0.25)
996
997 Utility:Tween(CloseButton, {TextColor3 = Theme.PrimaryTextColor}, 0.25)
998
999 task.wait(0.25)
1000
1001 Utility:Destroy()
1002 end)
1003
1004 -- // Prefix
1005 UserInputService.InputBegan:Connect(function(Input, GameProcessedEvent)
1006 if not GameProcessedEvent then
1007 if Input.KeyCode.Name == Library.Prefix.Name then
1008 if Main.Position.Y == UDim.new(1, 37) or Main.Position.Y == UDim.new(1, 36) or Main.Position.Y == UDim.new(0, -72) then
1009 UpdateFrameSizes()
1010 CommandInput:CaptureFocus()
1011 if string.find(Position, 'bottom') then
1012 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, -36)}, 0.25)
1013
1014 task.wait(0.25)
1015
1016 CommandsHolder.Visible = true
1017
1018 Utility:Tween(CommandsHolder, {BackgroundTransparency = 0.25}, 0.25)
1019
1020 task.wait(0.25)
1021
1022 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1023 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1024 if Instance:IsA('Frame') then
1025 Utility:Tween(Instance, {BackgroundTransparency = 0.25}, 0.25)
1026 end
1027
1028 if Utility:HasProperty(Instance, 'TextTransparency') then
1029 Utility:Tween(Instance, {TextTransparency = 0}, 0.25)
1030 end
1031 end
1032 end
1033 else
1034 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, 36)}, 0.25)
1035
1036 task.wait(0.25)
1037
1038 CommandsHolder.Visible = true
1039
1040 Utility:Tween(CommandsHolder, {BackgroundTransparency = 0.25}, 0.25)
1041
1042 task.wait(0.25)
1043
1044 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1045 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1046 if Instance:IsA('Frame') then
1047 Utility:Tween(Instance, {BackgroundTransparency = 0.25}, 0.25)
1048 end
1049
1050 if Utility:HasProperty(Instance, 'TextTransparency') then
1051 Utility:Tween(Instance, {TextTransparency = 0}, 0.25)
1052 end
1053 end
1054 end
1055 end
1056 end
1057 end
1058 end
1059 end)
1060
1061 -- // Execute Command
1062 local function Execute(String)
1063 local Split = String:split(' ')
1064 local FoundCommand
1065 local ArguementFounds
1066 local First = Split[1]:lower():gsub(Utility:KeyCodeToString(Library.Prefix), '')
1067 for i,v in ipairs(Commands) do
1068 if Split[1]:lower() == v.Name:lower() then
1069
1070 FoundCommand = v
1071 else
1072 for _,selected in next, v.Arguments do
1073 if Split[1]:lower() == selected:lower() then
1074
1075 FoundCommand = v
1076 ArguementFounds = v.Arguments
1077 end
1078 end
1079 end
1080 end
1081 if not HoverDebounce then
1082 if Main.Position.Y == UDim.new(1, 0) or Main.Position.Y == UDim.new(0, -36) then
1083 task.spawn(function()
1084 Execute(CommandInput.Text)
1085 CommandInput.Text = ''
1086 end)
1087
1088 task.spawn(function()
1089 HoverDebounce = true
1090 task.wait(0.5)
1091 HoverDebounce = false
1092 end)
1093
1094 if string.find(Position, 'bottom') then
1095 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1096 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1097 if Instance:IsA('Frame') then
1098 Utility:Tween(Instance, {BackgroundTransparency = 1}, 0.25)
1099 end
1100
1101 if Utility:HasProperty(Instance, 'TextTransparency') then
1102 Utility:Tween(Instance, {TextTransparency = 1}, 0.25)
1103 end
1104 end
1105 end
1106
1107 task.wait(0.25)
1108
1109 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, 36)}, 0.25)
1110
1111 task.wait(0.25)
1112
1113 Utility:Tween(CommandsHolder, {BackgroundTransparency = 1}, 0.25)
1114
1115 task.wait(0.25)
1116
1117 CommandsHolder.Visible = false
1118 else
1119 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1120 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1121 if Instance:IsA('Frame') then
1122 Utility:Tween(Instance, {BackgroundTransparency = 1}, 0.25)
1123 end
1124
1125 if Utility:HasProperty(Instance, 'TextTransparency') then
1126 Utility:Tween(Instance, {TextTransparency = 1}, 0.25)
1127 end
1128 end
1129 end
1130
1131 task.wait(0.25)
1132
1133 Utility:Tween(CommandsHolder, {BackgroundTransparency = 1}, 0.25)
1134
1135 task.wait(0.25)
1136
1137 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, -36)}, 0.25)
1138
1139 task.wait(0.25)
1140
1141 CommandsHolder.Visible = false
1142 end
1143
1144 end
1145 else
1146 pcall(function()
1147 task.spawn(FoundCommand.Callback, ArguementFounds, Players.LocalPlayer)
1148 end)
1149 if Main.Position.Y == UDim.new(1, 0) or Main.Position.Y == UDim.new(0, -36) then
1150 task.spawn(function()
1151 Execute(CommandInput.Text)
1152 CommandInput.Text = ''
1153 end)
1154
1155 if not HoverDebounce then
1156 task.spawn(function()
1157 HoverDebounce = true
1158 task.wait(0.5)
1159 HoverDebounce = false
1160 end)
1161
1162 if string.find(Position, 'bottom') then
1163 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1164 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1165 if Instance:IsA('Frame') then
1166 Utility:Tween(Instance, {BackgroundTransparency = 1}, 0.25)
1167 end
1168
1169 if Utility:HasProperty(Instance, 'TextTransparency') then
1170 Utility:Tween(Instance, {TextTransparency = 1}, 0.25)
1171 end
1172 end
1173 end
1174
1175 task.wait(0.25)
1176
1177 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, 36)}, 0.25)
1178
1179 task.wait(0.25)
1180
1181 Utility:Tween(CommandsHolder, {BackgroundTransparency = 1}, 0.25)
1182
1183 task.wait(0.25)
1184
1185 CommandsHolder.Visible = false
1186 else
1187 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1188 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1189 if Instance:IsA('Frame') then
1190 Utility:Tween(Instance, {BackgroundTransparency = 1}, 0.25)
1191 end
1192
1193 if Utility:HasProperty(Instance, 'TextTransparency') then
1194 Utility:Tween(Instance, {TextTransparency = 1}, 0.25)
1195 end
1196 end
1197 end
1198
1199 task.wait(0.25)
1200
1201 Utility:Tween(CommandsHolder, {BackgroundTransparency = 1}, 0.25)
1202
1203 task.wait(0.25)
1204
1205 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, -36)}, 0.25)
1206
1207 task.wait(0.25)
1208
1209 CommandsHolder.Visible = false
1210 end
1211 end
1212 end
1213end
1214end
1215
1216-- // Search Commands
1217CommandInput:GetPropertyChangedSignal('Text'):Connect(function()
1218 if CommandInput.Text == '' then
1219 for _, Instance in next, CommandsHolderScrolling:GetChildren() do
1220 if not Instance:IsA('UIListLayout') then
1221 Instance.Visible = true
1222
1223 UpdateFrameSizes()
1224 end
1225 end
1226 else
1227 local Split = CommandInput.Text:split()
1228 local Full = ''
1229
1230 for Index, String in next, Split do
1231 if Index == 1 then
1232 Full = Full .. Split[1]:gsub(Utility:KeyCodeToString(Library.Prefix), '')
1233 else
1234 Full = Full .. Split[Index]
1235 end
1236 end
1237
1238 CommandInput.Text = Full
1239
1240 for _, Instance in next, CommandsHolderScrolling:GetChildren() do
1241 if not Instance:IsA('UIListLayout') then
1242 if string.find(Instance.Name:gsub('CommandHolder', ''):lower(), CommandInput.Text:lower()) then
1243 Instance.Visible = true
1244
1245 UpdateFrameSizes()
1246 else
1247
1248 Instance.Visible = false
1249
1250 UpdateFrameSizes()
1251 end
1252 end
1253 end
1254 end
1255end)
1256
1257-- // Command Entered
1258CommandInput.FocusLost:Connect(function()
1259 if not HoverDebounce then
1260 task.spawn(function()
1261 HoverDebounce = true
1262 task.wait(0.5)
1263 HoverDebounce = false
1264 end)
1265
1266 if not IsInCommandsHolder and not Dragging then
1267 if Main.Position.Y == UDim.new(1, 0) or Main.Position.Y == UDim.new(0, -36) then
1268 task.spawn(function()
1269 Execute(CommandInput.Text)
1270 CommandInput.Text = ''
1271 end)
1272
1273 if string.find(Position, 'bottom') then
1274 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1275 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1276 if Instance:IsA('Frame') then
1277 Utility:Tween(Instance, {BackgroundTransparency = 1}, 0.25)
1278 end
1279
1280 if Utility:HasProperty(Instance, 'TextTransparency') then
1281 Utility:Tween(Instance, {TextTransparency = 1}, 0.25)
1282 end
1283 end
1284 end
1285
1286 task.wait(0.25)
1287
1288 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, 36)}, 0.25)
1289
1290 task.wait(0.25)
1291
1292 Utility:Tween(CommandsHolder, {BackgroundTransparency = 1}, 0.25)
1293
1294 task.wait(0.25)
1295
1296 CommandsHolder.Visible = false
1297 else
1298 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1299 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1300 if Instance:IsA('Frame') then
1301 Utility:Tween(Instance, {BackgroundTransparency = 1}, 0.25)
1302 end
1303
1304 if Utility:HasProperty(Instance, 'TextTransparency') then
1305 Utility:Tween(Instance, {TextTransparency = 1}, 0.25)
1306 end
1307 end
1308 end
1309
1310 task.wait(0.25)
1311
1312 Utility:Tween(CommandsHolder, {BackgroundTransparency = 1}, 0.25)
1313
1314 task.wait(0.25)
1315
1316 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, -36)}, 0.25)
1317
1318 task.wait(0.25)
1319
1320 CommandsHolder.Visible = false
1321 end
1322 end
1323 end
1324 end
1325end)
1326
1327-- // Tool Tips
1328function CreateToolTip(Text, Clone, Enabled)
1329 local ToolTip = Container.ToolTip
1330
1331 if Enabled then
1332 local Size = TextService:GetTextSize(Clone, ToolTip.TextSize, ToolTip.Font, Vector2.new(300, math.huge))
1333 Utility:Tween(ToolTip, {Size = UDim2.new(0, Size.X + 5, 0, Size.Y + 5)}, 0.25)
1334
1335 if ToolTip.Visible then
1336 RunService:UnbindFromRenderStep('ToolTip')
1337
1338 ToolTip.Visible = false
1339 end
1340
1341 RunService:BindToRenderStep('ToolTip', 1, function()
1342 local MouseLocation = UserInputService:GetMouseLocation()
1343 local ViewportSize = Workspace.CurrentCamera.ViewportSize
1344
1345 local Offset = UDim2.new(0, 0, 0, 0)
1346 local NewPosition = UDim2.new(MouseLocation.X / ViewportSize.X, 0, MouseLocation.Y / ViewportSize.Y, 0) + Offset
1347
1348 Utility:Tween(ToolTip, {Position = NewPosition}, 0.25)
1349 end)
1350
1351 ToolTip.Text = Text
1352 ToolTip.Visible = true
1353
1354 else
1355 if ToolTip.Visible then
1356 ToolTip.Visible = false
1357 RunService:UnbindFromRenderStep('ToolTip')
1358 end
1359 end
1360
1361end
1362
1363local WindowFunctions = {}
1364
1365function WindowFunctions:ChangePrefix(Prefix)
1366 Library.Prefix = Utility:StringToKeyCode(Prefix)
1367end
1368
1369function WindowFunctions:AddTheme(Name, Theme)
1370 if Library.Themes[Name] then
1371 Utility:Log('Error', 'A Theme Already Exists With The Name' .. Name)
1372 else
1373 Library.Themes[Name:lower()] = Theme
1374 end
1375end
1376
1377function WindowFunctions:GetThemes(Names)
1378 if Names then
1379 local Table = {}
1380
1381 for Index, Theme in next, Library.Themes do
1382 table.insert(Table, Index)
1383 end
1384
1385 return Table
1386 else
1387 return Library.Themes
1388 end
1389end
1390
1391function WindowFunctions:ChangeTheme(NewTheme)
1392 local function ChangeThemeActive()
1393 task.spawn(function()
1394 ChangeTheme = true
1395
1396 task.wait()
1397
1398 ChangeTheme = false
1399 end)
1400 end
1401
1402 if type(NewTheme) == 'table' then
1403 Theme = NewTheme
1404 Library.Themes['custom'] = Theme
1405 ChangeThemeActive()
1406
1407 elseif type(NewTheme) == 'string' then
1408 if Library.Themes[NewTheme] then
1409 Library.Theme = Library.Themes[NewTheme]
1410 Theme = Library.Theme
1411 ChangeThemeActive()
1412 else
1413 Utility:Log('Error', 'Theme Doesn\'t exist: ' .. NewTheme)
1414 end
1415 end
1416end
1417
1418function WindowFunctions:CreateNotification(Title, Text, Duration)
1419 local function NotificationCount()
1420 local Amount = 0
1421
1422 for _, Notification in next, Container:GetChildren() do
1423 if string.find(Notification.Name, 'Notification') then
1424 Amount += 1
1425 end
1426 end
1427
1428 return Amount
1429 end
1430
1431 task.wait(0.5)
1432
1433 task.spawn(function()
1434 local Title = Title or 'Title'
1435 local Text = Text or 'Text'
1436 local Duration = Duration or 5
1437
1438 Utility:Create('Frame', {
1439 Parent = Container,
1440 Name = 'Notification' .. tostring(NotificationCount() + 1),
1441 BackgroundColor3 = Library.Theme.BackgroundColor,
1442 BorderSizePixel = 0,
1443 Position = UDim2.new(1, 300, 1, -30),
1444 Size = UDim2.new(0, 300, 0, 50),
1445 BackgroundTransparency = 0,
1446 AnchorPoint = Vector2.new(1, 1)
1447 }, {
1448 Utility:Create('UICorner', {
1449 CornerRadius = UDim.new(0, 5),
1450 Name = 'NotificationCorner'
1451 }),
1452 Utility:Create('UIStroke', {
1453 Name = 'NotificationStroke',
1454 ApplyStrokeMode = 'Contextual',
1455 Color = Library.Theme.AccentColor,
1456 LineJoinMode = 'Round',
1457 Thickness = 1
1458 }),
1459 Utility:Create('TextLabel', {
1460 Name = 'NotificationTitle',
1461 BackgroundTransparency = 1,
1462 Position = UDim2.new(0, 0, 0, -1),
1463 Size = UDim2.new(0, 300, 0, 30),
1464 Font = Enum.Font.Gotham,
1465 Text = Title,
1466 TextColor3 = Library.Theme.PrimaryTextColor,
1467 TextSize = 16,
1468 TextXAlignment = Enum.TextXAlignment.Left
1469 }, {
1470 Utility:Create('UIPadding', {
1471 Name = 'NotificationTitlePadding',
1472 PaddingLeft = UDim.new(0, 7)
1473 })
1474 }),
1475 Utility:Create('TextLabel', {
1476 Name = 'NotificationText',
1477 BackgroundTransparency = 1,
1478 Position = UDim2.new(0, 0, 0, 25),
1479 Size = UDim2.new(0, 300, 0, 30),
1480 Font = Enum.Font.Gotham,
1481 Text = Text,
1482 TextWrapped = true,
1483 TextColor3 = Library.Theme.SecondaryTextColor,
1484 TextSize = 14,
1485 TextXAlignment = Enum.TextXAlignment.Left
1486 }, {
1487 Utility:Create('UIPadding', {
1488 Name = 'NotificationTextPadding',
1489 PaddingLeft = UDim.new(0, 7)
1490 })
1491 })
1492 })
1493
1494 local Holder = Container['Notification' .. tostring(NotificationCount())]
1495 local TitleObj = Holder['NotificationTitle']
1496 local TextObj = Holder['NotificationText']
1497 local TextSize = TextService:GetTextSize(Text, 14, Enum.Font.Gotham, Vector2.new(300, math.huge))
1498
1499 Holder.Size = UDim2.new(0, 300, 0, TextSize.Y + 30)
1500 TextObj.Size = UDim2.new(0, 300, 0, TextSize.Y)
1501
1502 if NotificationCount() > 1 then
1503 local PreviousSizes = 0
1504
1505 for _, Notification in next, Container:GetChildren() do
1506 if string.find(Notification.Name, 'Notification') and Notification ~= Holder.Parent['Notification' .. tostring(NotificationCount())] and Notification.Position.X == UDim.new(1, -30) then
1507 local AbsoluteY = Notification.AbsoluteSize.Y + 5
1508
1509 PreviousSizes = PreviousSizes + AbsoluteY
1510 end
1511 end
1512
1513 Holder.Position = UDim2.new(1, 300, 1, -30 - PreviousSizes)
1514
1515 Utility:Tween(Holder, {Position = UDim2.new(1, -30, 1, -30 - PreviousSizes)}, 0.25)
1516 else
1517 Utility:Tween(Holder, {Position = UDim2.new(1, -30, 1, -30)}, 0.25)
1518 end
1519
1520 task.wait(Duration - 0.5)
1521
1522 Utility:Tween(Holder, {BackgroundTransparency = 0.8}, 0.25)
1523 Utility:Tween(TitleObj, {TextTransparency = 0.5}, 0.25)
1524 Utility:Tween(TextObj, {TextTransparency = 0.5}, 0.25)
1525
1526 task.wait(0.25)
1527
1528 Utility:Tween(Holder, {Position = UDim2.new(1, 300, 1, Holder.Position.Y.Offset)}, 0.25)
1529
1530 task.wait(0.25)
1531
1532 Holder:Destroy()
1533 end)
1534end
1535
1536function WindowFunctions:AddCommand(Name, Arguments, Description, Callback)
1537 Commands[#Commands+1] = {
1538 Name = Name:lower(),
1539 Arguments = Arguments,
1540 Description = Description,
1541 Callback = Callback
1542 }
1543
1544 local function Highlight(String, Color)
1545 return string.format('<font color = "rgb(%d, %d, %d)">%s</font>', Color.r * 255, Color.g * 255, Color.b * 255, String)
1546 end
1547
1548 local function ConstructString(Highlighted)
1549 if Highlighted then
1550 local String = '' .. Highlight(Name, Library.Theme.PrimaryTextColor) .. ' '
1551
1552 for _, Argument in next, Arguments do
1553 String = String .. Highlight('{' .. Argument .. '}', Library.Theme.SecondaryTextColor) .. ' '
1554 end
1555
1556 String = String .. Highlight('| ', Library.Theme.AccentColor) .. Highlight(Description, Library.Theme.SecondaryTextColor)
1557
1558 return String
1559 else
1560 local String = Name .. ' '
1561
1562 for _, Argument in next, Arguments do
1563 String = String .. '{' .. Argument .. '}' .. ' '
1564 end
1565
1566 String = String .. '| ' .. Description
1567
1568 return String
1569 end
1570 end
1571
1572 Utility:Create('Frame', {
1573 Parent = CommandsHolderScrolling,
1574 BackgroundColor3 = Theme.BackgroundColor,
1575 BorderSizePixel = 0,
1576 BackgroundTransparency = 0.25,
1577 Name = Name .. 'CommandHolder',
1578 Size = UDim2.new(0, 490, 0, 30)
1579 }, {
1580 Utility:Create('UICorner', {
1581 CornerRadius = UDim.new(0, 5),
1582 Name = Name .. 'CommandsHolderCorner'
1583 }),
1584 Utility:Create('TextLabel', {
1585 Name = Name .. 'Text',
1586 BackgroundColor3 = Theme.BackgroundColor,
1587 BackgroundTransparency = 1,
1588 TextTransparency = 0,
1589 BorderSizePixel = 0,
1590 RichText = true,
1591 Size = UDim2.new(0, 490, 0, 30),
1592 Font = Enum.Font.Gotham,
1593 Text = ConstructString(true),
1594 TextColor3 = Theme.PrimaryTextColor,
1595 TextSize = 15,
1596 ZIndex = 2,
1597 TextXAlignment = Enum.TextXAlignment.Left
1598 }, {
1599 Utility:Create('UIPadding', {
1600 PaddingLeft = UDim.new(0, 5),
1601 Name = Name .. 'Padding'
1602 })
1603 }),
1604 Utility:Create('TextButton', {
1605 Name = Name .. 'Button',
1606 Size = UDim2.new(0, 490, 0, 30),
1607 BackgroundTransparency = 1,
1608 AutoButtonColor = false,
1609 BorderSizePixel = 0,
1610 ZIndex = 100,
1611 Text = ''
1612 }, {
1613 Utility:Create('UICorner', {
1614 CornerRadius = UDim.new(0, 5),
1615 Name = Name .. 'ButtonCorner'
1616 })
1617 })
1618 })
1619
1620 -- // Variables
1621 local CommandHolder = CommandsHolderScrolling[Name .. 'CommandHolder']
1622 local Button = CommandHolder[Name .. 'Button']
1623
1624 -- // Theme Updates
1625 task.spawn(function()
1626 while task.wait() do
1627 if ChangeTheme then
1628 if not BreakLoops then
1629 Utility:Tween(CommandsHolderScrolling[Name .. 'CommandHolder'], {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
1630 Utility:Tween(CommandsHolderScrolling[Name .. 'CommandHolder'][Name .. 'Text'], {BackgroundColor3 = Library.Theme.BackgroundColor}, 0.25)
1631 Utility:Tween(CommandsHolderScrolling[Name .. 'CommandHolder'][Name .. 'Text'], {TextColor3 = Library.Theme.PrimaryTextColor}, 0.25)
1632 CommandHolder[Name .. 'Text'].Text = ConstructString(true)
1633 else
1634 break
1635 end
1636 end
1637 end
1638 end)
1639
1640 -- // Events
1641 Button.MouseButton1Down:Connect(function()
1642 Utility:Tween(CommandHolder, {BackgroundColor3 = Utility:Lighten(Theme.BackgroundColor)}, 0.25)
1643
1644 task.wait(0.25)
1645
1646 pcall(Execute(Name))
1647
1648 Utility:Tween(CommandHolder, {BackgroundColor3 = Theme.BackgroundColor}, 0.25)
1649
1650 task.wait(0.25)
1651
1652 if not HoverDebounce then
1653 task.spawn(function()
1654 HoverDebounce = true
1655 task.wait(0.5)
1656 HoverDebounce = false
1657 end)
1658
1659 if Main.Position.Y == UDim.new(1, 1) or Main.Position.Y == UDim.new(0, -37) then
1660 if string.find(Position, 'bottom') then
1661 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, 36)}, 0.25)
1662
1663 task.wait(0.1)
1664
1665 CommandInput.Text = ''
1666
1667 task.wait(0.25)
1668
1669 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1670 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1671 if Instance:IsA('Frame') then
1672 Utility:Tween(Instance, {BackgroundTransparency = 1}, 0.25)
1673 end
1674
1675 if Utility:HasProperty(Instance, 'TextTransparency') then
1676 Utility:Tween(Instance, {TextTransparency = 1}, 0.25)
1677 end
1678 end
1679 end
1680
1681 task.wait(0.25)
1682
1683 Utility:Tween(CommandsHolder, {BackgroundTransparency = 1}, 0.25)
1684
1685 task.wait(0.25)
1686
1687 CommandsHolder.Visible = false
1688 else
1689 Utility:Tween(Main, {Position = Main.Position + UDim2.new(0, 0, 0, -35)}, 0.25)
1690
1691 CommandInput.Text = ''
1692
1693 task.wait(0.25)
1694
1695 for _, Instance in next, CommandsHolderScrolling:GetDescendants() do
1696 if not Instance:IsA('UIListLayout') and not Instance:IsA('TextButton') then
1697 if Instance:IsA('Frame') then
1698 Utility:Tween(Instance, {BackgroundTransparency = 1}, 0.25)
1699 end
1700
1701 if Utility:HasProperty(Instance, 'TextTransparency') then
1702 Utility:Tween(Instance, {TextTransparency = 1}, 0.25)
1703 end
1704 end
1705 end
1706
1707 task.wait(0.25)
1708
1709 Utility:Tween(CommandsHolder, {BackgroundTransparency = 1}, 0.25)
1710
1711 task.wait(0.25)
1712
1713 CommandsHolder.Visible = false
1714 end
1715 end
1716 end
1717 end)
1718
1719 CommandHolder.MouseEnter:Connect(function()
1720 Utility:Tween(CommandHolder, {BackgroundColor3 = Utility:Lighten(Theme.BackgroundColor)}, 0.25)
1721
1722 CreateToolTip(ConstructString(true), ConstructString(false), true)
1723 end)
1724
1725 CommandHolder.MouseLeave:Connect(function()
1726 Utility:Tween(CommandHolder, {BackgroundColor3 = Theme.BackgroundColor}, 0.25)
1727
1728 CreateToolTip(nil, nil, false)
1729 end)
1730end
1731
1732return WindowFunctions
1733end
1734return Library