Message
Message
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Global;
local Parented = pcall(function() ScreenGui.Parent = GetHUI(); end);
if not Parented then ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui", 9e9)
end;
--[[
You can access Toggles & Options through (I'm planning to remove **a** option):
a) getgenv().Toggles, getgenv().Options (IY will break this getgenv)
b) getgenv().Linoria.Toggles, getgenv().Linoria.Options
c) Library.Toggles, Library.Options
--]]
getgenv().Linoria = {
Toggles = Toggles,
Options = Options
}
getgenv().Toggles = Toggles; -- if you load infinite yeild after you executed any
script with LinoriaLib it will just break the whole UI lib :/ (thats why I added
getgenv().Linoria)
getgenv().Options = Options;
HudRegistry = {};
OpenedFrames = {};
DependencyBoxes = {};
UnloadSignals = {};
Signals = {};
ScreenGui = ScreenGui;
ActiveTab = nil;
Toggled = false;
CanDrag = true;
CantDragForced = false;
NotifySide = "Left";
ShowCustomCursor = true;
ShowToggleFrameInKeybinds = true;
VideoLink = "";
TotalTabs = 0;
if Library.IsMobile then
Library.MinSize = Vector2.new(550, 200); -- Make UI little bit smaller.
end
local RainbowStep = 0
local Hue = 0
table.insert(Library.Signals, RenderStepped:Connect(function(Delta)
RainbowStep = RainbowStep + Delta
for i = 1, #PlayerList do
PlayerList[i] = PlayerList[i].Name;
end;
return PlayerList;
end;
for i = 1, #TeamList do
TeamList[i] = TeamList[i].Name;
end;
return TeamList;
end;
if not i then
return Library:Notify(event);
end;
function Library:AttemptSave()
if Library.SaveManager then
Library.SaveManager:Save();
end;
end;
return _Instance;
end;
function Library:ApplyTextStroke(Inst)
Inst.TextStrokeTransparency = 1;
return Library:Create('UIStroke', {
Color = Color3.new(0, 0, 0);
Thickness = 1;
LineJoinMode = Enum.LineJoinMode.Miter;
Parent = Inst;
});
end;
Library:ApplyTextStroke(_Instance);
Library:AddToRegistry(_Instance, {
TextColor3 = 'FontColor';
}, IsHud);
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
Instance.Position = UDim2.new(
0,
Mouse.X - ObjPos.X + (Instance.Size.X.Offset *
Instance.AnchorPoint.X),
0,
Mouse.Y - ObjPos.Y + (Instance.Size.Y.Offset *
Instance.AnchorPoint.Y)
);
RenderStepped:Wait();
end;
end;
end);
else
local Dragging, DraggingInput, DraggingStart, StartPosition;
InputService.TouchStarted:Connect(function(Input)
if IsMainWindow == true and Library.CantDragForced == true then
Dragging = false
return;
end
Dragging = true;
end;
end);
InputService.TouchMoved:Connect(function(Input)
if IsMainWindow == true and Library.CantDragForced == true then
Dragging = false;
return;
end
Instance.Position = UDim2.new(
StartPosition.X.Scale,
StartPosition.X.Offset + OffsetPos.X,
StartPosition.Y.Scale,
StartPosition.Y.Offset + OffsetPos.Y
);
end;
end);
InputService.TouchEnded:Connect(function(Input)
if Input == DraggingInput then
Dragging = false;
end;
end);
end;
end;
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
Parent.Position = UDim2.new(
0,
Mouse.X - ObjPos.X + (Parent.Size.X.Offset *
Parent.AnchorPoint.X),
0,
Mouse.Y - ObjPos.Y + (Parent.Size.Y.Offset *
Parent.AnchorPoint.Y)
);
RenderStepped:Wait();
end;
end;
end);
else
Library:MakeDraggable(Parent, Cutoff, IsMainWindow)
end;
end;
local OffsetPos;
Resizer.Parent = Instance;
ResizerImage.MouseButton1Down:Connect(function()
if not OffsetPos then
OffsetPos = Vector2.new(Mouse.X - (Instance.AbsolutePosition.X +
Instance.AbsoluteSize.X), Mouse.Y - (Instance.AbsolutePosition.Y +
Instance.AbsoluteSize.Y));
ResizerImage.BackgroundTransparency = 1
ResizerImage.Size = UDim2.fromOffset(Library.ScreenGui.AbsoluteSize.X,
Library.ScreenGui.AbsoluteSize.Y);
ResizerImage.Position = UDim2.new();
ResizerImageUICorner.Parent = nil;
ResizerImage.Parent = Library.ScreenGui;
end;
end);
ResizerImage.MouseMoved:Connect(function()
if OffsetPos then
local MousePos = Vector2.new(Mouse.X - OffsetPos.X, Mouse.Y -
OffsetPos.Y);
local FinalSize = Vector2.new(math.clamp(MousePos.X -
Instance.AbsolutePosition.X, MinSize.X, math.huge), math.clamp(MousePos.Y -
Instance.AbsolutePosition.Y, MinSize.Y, math.huge));
Instance.Size = UDim2.fromOffset(FinalSize.X, FinalSize.Y);
end;
end);
ResizerImage.MouseEnter:Connect(function()
FinishResize(ResizerImage_HoverTransparency);
end);
ResizerImage.MouseLeave:Connect(function()
FinishResize(1);
end);
ResizerImage.MouseButton1Up:Connect(function()
FinishResize(ResizerImage_HoverTransparency);
end);
end;
Visible = false,
});
Parent = Tooltip;
});
Library:AddToRegistry(Tooltip, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
Library:AddToRegistry(Label, {
TextColor3 = 'FontColor',
});
HoverInstance.MouseEnter:Connect(function()
if Library:MouseIsOverOpenedFrame() then
return
end
IsHovering = true
while IsHovering do
RunService.Heartbeat:Wait()
Tooltip.Position = UDim2.fromOffset(Mouse.X + 15, Mouse.Y + 12)
end
end)
HoverInstance.MouseLeave:Connect(function()
IsHovering = false
Tooltip.Visible = false
end)
if LibraryMainOuterFrame then
LibraryMainOuterFrame:GetPropertyChangedSignal("Visible"):Connect(function()
if LibraryMainOuterFrame.Visible == false then
IsHovering = false
Tooltip.Visible = false
end
end)
end
end
HighlightInstance.MouseEnter:Connect(function()
doHighlight()
end)
HighlightInstance.MouseMoved:Connect(function()
doHighlight()
end)
HighlightInstance.MouseLeave:Connect(function()
undoHighlight()
end)
end;
function Library:MouseIsOverOpenedFrame(Input)
local Pos = Mouse;
if Library.IsMobile and Input then
Pos = Input.Position;
end;
for Frame, _ in next, Library.OpenedFrames do
local AbsPos, AbsSize = Frame.AbsolutePosition, Frame.AbsoluteSize;
return true;
end;
end;
end;
return true;
end;
end;
function Library:UpdateDependencyBoxes()
for _, Depbox in next, Library.DependencyBoxes do
Depbox:Update();
end;
end;
function Library:GetDarkerColor(Color)
local H, S, V = Color3.toHSV(Color);
return Color3.fromHSV(H, S, V / 1.5);
end;
Library.AccentColorDark = Library:GetDarkerColor(Library.AccentColor);
table.insert(Library.Registry, Data);
Library.RegistryMap[Instance] = Data;
if IsHud then
table.insert(Library.HudRegistry, Data);
end;
end;
function Library:RemoveFromRegistry(Instance)
local Data = Library.RegistryMap[Instance];
if Data then
for Idx = #Library.Registry, 1, -1 do
if Library.Registry[Idx] == Data then
table.remove(Library.Registry, Idx);
end;
end;
Library.RegistryMap[Instance] = nil;
end;
end;
function Library:UpdateColorsUsingRegistry()
-- TODO: Could have an 'active' list of objects
-- where the active list only contains Visible objects.
-- The above would be especially efficient for a rainbow menu color or live
color-changing.
for Idx, Object in next, Library.Registry do
for Property, ColorIdx in next, Object.Properties do
if typeof(ColorIdx) == 'string' then
Object.Instance[Property] = Library[ColorIdx];
elseif typeof(ColorIdx) == 'function' then
Object.Instance[Property] = ColorIdx()
end
end;
end;
end;
function Library:GiveSignal(Signal)
-- Only used for signals not attached to library instances, as those should be
cleaned up on object destruction by Roblox
table.insert(Library.Signals, Signal)
end
function Library:Unload()
-- Unload all of the signals
for Idx = #Library.Signals, 1, -1 do
local Connection = table.remove(Library.Signals, Idx)
Connection:Disconnect()
end
ScreenGui:Destroy()
end
function Library:OnUnload(Callback)
table.insert(Library.UnloadSignals, Callback)
end
Library:GiveSignal(ScreenGui.DescendantRemoving:Connect(function(Instance)
if Library.RegistryMap[Instance] then
Library:RemoveFromRegistry(Instance);
end;
end))
do
local Funcs = {};
local ColorPicker = {
Value = Info.Default;
Transparency = Info.Transparency or 0;
Type = 'ColorPicker';
Title = typeof(Info.Title) == 'string' and Info.Title or 'Color
picker',
Callback = Info.Callback or function(Color) end;
};
function ColorPicker:SetHSVFromRGB(Color)
local H, S, V = Color3.toHSV(Color);
ColorPicker.Hue = H;
ColorPicker.Sat = S;
ColorPicker.Vib = V;
end;
ColorPicker:SetHSVFromRGB(ColorPicker.Value);
-- 1/16/23
-- Rewrote this to be placed inside the Library ScreenGui
-- There was some issue which caused RelativeOffset to be way off
-- Thus the color picker would never show
DisplayFrame:GetPropertyChangedSignal('AbsolutePosition'):Connect(function()
PickerFrameOuter.Position =
UDim2.fromOffset(DisplayFrame.AbsolutePosition.X, DisplayFrame.AbsolutePosition.Y +
18);
end)
local PickerFrameInner = Library:Create('Frame', {
BackgroundColor3 = Library.BackgroundColor;
BorderColor3 = Library.OutlineColor;
BorderMode = Enum.BorderMode.Inset;
Size = UDim2.new(1, 0, 1, 0);
ZIndex = 16;
Parent = PickerFrameOuter;
});
Library:Create('UIGradient', {
Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
});
Rotation = 90;
Parent = HueBoxInner;
});
Library:ApplyTextStroke(HueBox);
if Info.Transparency then
TransparencyBoxOuter = Library:Create('Frame', {
BorderColor3 = Color3.new(0, 0, 0);
Position = UDim2.fromOffset(4, 251);
Size = UDim2.new(1, -8, 0, 15);
ZIndex = 19;
Parent = PickerFrameInner;
});
TransparencyBoxInner = Library:Create('Frame', {
BackgroundColor3 = ColorPicker.Value;
BorderColor3 = Library.OutlineColor;
BorderMode = Enum.BorderMode.Inset;
Size = UDim2.new(1, 0, 1, 0);
ZIndex = 19;
Parent = TransparencyBoxOuter;
});
Library:AddToRegistry(TransparencyBoxInner, { BorderColor3 =
'OutlineColor' });
Library:Create('ImageLabel', {
BackgroundTransparency = 1;
Size = UDim2.new(1, 0, 1, 0);
Image = 'http://www.roblox.com/asset/?id=12978095818';
ZIndex = 20;
Parent = TransparencyBoxInner;
});
TransparencyCursor = Library:Create('Frame', {
BackgroundColor3 = Color3.new(1, 1, 1);
AnchorPoint = Vector2.new(0.5, 0);
BorderColor3 = Color3.new(0, 0, 0);
Size = UDim2.new(0, 1, 1, 0);
ZIndex = 21;
Parent = TransparencyBoxInner;
});
end;
local ContextMenu = {}
do
ContextMenu.Options = {}
ContextMenu.Container = Library:Create('Frame', {
BorderColor3 = Color3.new(),
ZIndex = 14,
Visible = false,
Parent = ScreenGui
})
ContextMenu.Inner = Library:Create('Frame', {
BackgroundColor3 = Library.BackgroundColor;
BorderColor3 = Library.OutlineColor;
BorderMode = Enum.BorderMode.Inset;
Size = UDim2.fromScale(1, 1);
ZIndex = 15;
Parent = ContextMenu.Container;
});
Library:Create('UIListLayout', {
Name = 'Layout',
FillDirection = Enum.FillDirection.Vertical;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = ContextMenu.Inner;
});
Library:Create('UIPadding', {
Name = 'Padding',
PaddingLeft = UDim.new(0, 4),
Parent = ContextMenu.Inner,
});
ContextMenu.Container.Size = UDim2.fromOffset(
menuWidth + 8,
ContextMenu.Inner.Layout.AbsoluteContentSize.Y + 4
)
end
DisplayFrame:GetPropertyChangedSignal('AbsolutePosition'):Connect(updateMenuPositio
n)
ContextMenu.Inner.Layout:GetPropertyChangedSignal('AbsoluteContentSize'):Connect(up
dateMenuSize)
task.spawn(updateMenuPosition)
task.spawn(updateMenuSize)
Library:AddToRegistry(ContextMenu.Inner, {
BackgroundColor3 = 'BackgroundColor';
BorderColor3 = 'OutlineColor';
});
function ContextMenu:Show()
if Library.IsMobile then
Library.CanDrag = false;
end;
self.Container.Visible = true;
end
function ContextMenu:Hide()
if Library.IsMobile then
Library.CanDrag = true;
end;
self.Container.Visible = false;
end
Library:OnHighlight(Button, Button,
{ TextColor3 = 'AccentColor' },
{ TextColor3 = 'FontColor' }
);
Button.InputBegan:Connect(function(Input)
if Input.UserInputType ~= Enum.UserInputType.MouseButton1 or
Input.UserInputType ~= Enum.UserInputType.Touch then
return
end
Callback()
end)
end
end
ColorPicker.ContextMenu = ContextMenu;
Library:AddToRegistry(PickerFrameInner, { BackgroundColor3 =
'BackgroundColor'; BorderColor3 = 'OutlineColor'; });
Library:AddToRegistry(Highlight, { BackgroundColor3 = 'AccentColor'; });
Library:AddToRegistry(SatVibMapInner, { BackgroundColor3 =
'BackgroundColor'; BorderColor3 = 'OutlineColor'; });
HueBox.FocusLost:Connect(function(enter)
if enter then
local success, result = pcall(Color3.fromHex, HueBox.Text)
if success and typeof(result) == 'Color3' then
ColorPicker.Hue, ColorPicker.Sat, ColorPicker.Vib =
Color3.toHSV(result)
end
end
ColorPicker:Display()
end)
RgbBox.FocusLost:Connect(function(enter)
if enter then
local r, g, b = RgbBox.Text:match('(%d+),%s*(%d+),%s*(%d+)')
if r and g and b then
ColorPicker.Hue, ColorPicker.Sat, ColorPicker.Vib =
Color3.toHSV(Color3.fromRGB(r, g, b))
end
end
ColorPicker:Display()
end)
function ColorPicker:Display()
ColorPicker.Value = Color3.fromHSV(ColorPicker.Hue, ColorPicker.Sat,
ColorPicker.Vib);
SatVibMap.BackgroundColor3 = Color3.fromHSV(ColorPicker.Hue, 1, 1);
Library:Create(DisplayFrame, {
BackgroundColor3 = ColorPicker.Value;
BackgroundTransparency = ColorPicker.Transparency;
BorderColor3 = Library:GetDarkerColor(ColorPicker.Value);
});
if TransparencyBoxInner then
TransparencyBoxInner.BackgroundColor3 = ColorPicker.Value;
TransparencyCursor.Position = UDim2.new(1 -
ColorPicker.Transparency, 0, 0, 0);
end;
CursorOuter.Position = UDim2.new(ColorPicker.Sat, 0, 1 -
ColorPicker.Vib, 0);
HueCursor.Position = UDim2.new(0, 0, ColorPicker.Hue, 0);
Library:SafeCallback(ColorPicker.Callback, ColorPicker.Value);
Library:SafeCallback(ColorPicker.Changed, ColorPicker.Value);
end;
function ColorPicker:OnChanged(Func)
ColorPicker.Changed = Func;
Func(ColorPicker.Value)
end;
if ParentObj.Addons then
table.insert(ParentObj.Addons, ColorPicker)
end
function ColorPicker:Show()
for Frame, Val in next, Library.OpenedFrames do
if Frame.Name == 'Color' then
Frame.Visible = false;
Library.OpenedFrames[Frame] = nil;
end;
end;
PickerFrameOuter.Visible = true;
Library.OpenedFrames[PickerFrameOuter] = true;
end;
function ColorPicker:Hide()
PickerFrameOuter.Visible = false;
Library.OpenedFrames[PickerFrameOuter] = nil;
end;
ColorPicker.Transparency = Transparency or 0;
ColorPicker:SetHSVFromRGB(Color);
ColorPicker:Display();
end;
SatVibMap.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or
Input.UserInputType == Enum.UserInputType.Touch then
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1 or
Enum.UserInputType.Touch) do
local MinX = SatVibMap.AbsolutePosition.X;
local MaxX = MinX + SatVibMap.AbsoluteSize.X;
local MouseX = math.clamp(Mouse.X, MinX, MaxX);
RenderStepped:Wait();
end;
Library:AttemptSave();
end;
end);
HueSelectorInner.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or
Input.UserInputType == Enum.UserInputType.Touch then
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1 or
Enum.UserInputType.Touch) do
local MinY = HueSelectorInner.AbsolutePosition.Y;
local MaxY = MinY + HueSelectorInner.AbsoluteSize.Y;
local MouseY = math.clamp(Mouse.Y, MinY, MaxY);
RenderStepped:Wait();
end;
Library:AttemptSave();
end;
end);
DisplayFrame.InputBegan:Connect(function(Input)
if Library:MouseIsOverOpenedFrame() then
return;
end;
if Input.UserInputType == Enum.UserInputType.MouseButton1 or
Input.UserInputType == Enum.UserInputType.Touch then
if PickerFrameOuter.Visible then
ColorPicker:Hide()
else
ContextMenu:Hide()
ColorPicker:Show()
end;
elseif Input.UserInputType == Enum.UserInputType.MouseButton2 then
ContextMenu:Show()
ColorPicker:Hide()
end
end);
if TransparencyBoxInner then
TransparencyBoxInner.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or
Input.UserInputType == Enum.UserInputType.Touch then
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1 or
Enum.UserInputType.Touch) do
local MinX = TransparencyBoxInner.AbsolutePosition.X;
local MaxX = MinX + TransparencyBoxInner.AbsoluteSize.X;
local MouseX = math.clamp(Mouse.X, MinX, MaxX);
ColorPicker:Display();
RenderStepped:Wait();
end;
Library:AttemptSave();
end;
end);
end;
Library:GiveSignal(InputService.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or
Input.UserInputType == Enum.UserInputType.Touch then
local AbsPos, AbsSize = PickerFrameOuter.AbsolutePosition,
PickerFrameOuter.AbsoluteSize;
ColorPicker:Hide();
end;
ColorPicker:Display();
ColorPicker.DisplayFrame = DisplayFrame
Options[Idx] = ColorPicker;
return self;
end;
if KeyPicker.SyncToggleState then
Info.Modes = { 'Toggle' }
Info.Mode = 'Toggle'
end
Library:AddToRegistry(PickInner, {
BackgroundColor3 = 'BackgroundColor';
BorderColor3 = 'OutlineColor';
});
ToggleLabel:GetPropertyChangedSignal('AbsolutePosition'):Connect(function()
ModeSelectOuter.Position =
UDim2.fromOffset(ToggleLabel.AbsolutePosition.X + ToggleLabel.AbsoluteSize.X + 4,
ToggleLabel.AbsolutePosition.Y + 1);
end);
Library:AddToRegistry(ModeSelectInner, {
BackgroundColor3 = 'BackgroundColor';
BorderColor3 = 'OutlineColor';
});
Library:Create('UIListLayout', {
FillDirection = Enum.FillDirection.Vertical;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = ModeSelectInner;
});
-- Keybinds Text
local KeybindsToggle = {}
do
local KeybindsToggleContainer = Library:Create('Frame', {
BackgroundTransparency = 1;
Size = UDim2.new(1, 0, 0, 18);
Visible = false;
ZIndex = 110;
Parent = Library.KeybindContainer;
});
Library:AddToRegistry(KeybindsToggleOuter, {
BorderColor3 = 'Black';
});
Library:AddToRegistry(KeybindsToggleInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
Library:Create('UIListLayout', {
Padding = UDim.new(0, 4);
FillDirection = Enum.FillDirection.Horizontal;
HorizontalAlignment = Enum.HorizontalAlignment.Right;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = KeybindsToggleLabel;
});
Library:OnHighlight(KeybindsToggleRegion, KeybindsToggleOuter,
{ BorderColor3 = 'AccentColor' },
{ BorderColor3 = 'Black' },
function()
return true
end
);
function KeybindsToggle:Display(State)
KeybindsToggleInner.BackgroundColor3 = State and
Library.AccentColor or Library.MainColor;
KeybindsToggleInner.BorderColor3 = State and
Library.AccentColorDark or Library.OutlineColor;
KeybindsToggleLabel.TextColor3 = State and Library.AccentColor or
Library.FontColor;
function KeybindsToggle:SetText(text)
KeybindsToggleLabel.Text = text
end
function KeybindsToggle:SetVisibility(bool)
KeybindsToggleContainer.Visible = bool
end
function KeybindsToggle:SetNormal(bool)
KeybindsToggle.Normal = bool
KeybindsToggleOuter.BackgroundTransparency = if
KeybindsToggle.Normal then 1 else 0;
KeybindsToggleInner.BackgroundTransparency = if
KeybindsToggle.Normal then 1 else 0;
KeybindsToggleInner.BorderSizePixel = if KeybindsToggle.Normal then
0 else 1;
Library:GiveSignal(KeybindsToggleRegion.InputBegan:Connect(function(Input)
if KeybindsToggle.Normal then return end
KeybindsToggle.Loaded = true;
end;
function ModeButton:Select()
for _, Button in next, ModeButtons do
Button:Deselect();
end;
KeyPicker.Mode = Mode;
Label.TextColor3 = Library.AccentColor;
Library.RegistryMap[Label].Properties.TextColor3 = 'AccentColor';
ModeSelectOuter.Visible = false;
end;
function ModeButton:Deselect()
KeyPicker.Mode = nil;
Label.TextColor3 = Library.FontColor;
Library.RegistryMap[Label].Properties.TextColor3 = 'FontColor';
end;
Label.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 then
ModeButton:Select();
Library:AttemptSave();
end;
end);
ModeButtons[Mode] = ModeButton;
end;
function KeyPicker:Update()
if Info.NoUI then
return;
end;
if ShowToggle then
if KeybindsToggle.Loaded then
KeybindsToggle:SetNormal(false);
KeybindsToggle:SetVisibility(true);
KeybindsToggle:SetText(string.format('[%s] %s (%s)',
KeyPicker.Value, Info.Text, KeyPicker.Mode));
KeybindsToggle:Display(State);
end
else
if KeybindsToggle.Loaded then
KeybindsToggle:SetNormal(true);
end
end;
if KeybindsToggle.Loaded then
if ShowToggle then KeybindsToggle:SetNormal(false); else
KeybindsToggle:SetNormal(true); end;
KeybindsToggle:SetVisibility(true);
KeybindsToggle:SetText(string.format('[%s] %s (%s)',
KeyPicker.Value, Info.Text, KeyPicker.Mode));
KeybindsToggle:Display(State);
end
local YSize = 0
local XSize = 0
function KeyPicker:GetState()
if KeyPicker.Mode == 'Always' then
return true;
elseif KeyPicker.Mode == 'Hold' then
if KeyPicker.Value == 'None' then
return false;
end
function KeyPicker:SetValue(Data)
local Key, Mode = Data[1], Data[2];
DisplayLabel.Text = Key;
KeyPicker.Value = Key;
if ModeButtons[Mode] then ModeButtons[Mode]:Select(); end
KeyPicker:Update();
end;
function KeyPicker:OnClick(Callback)
KeyPicker.Clicked = Callback
end
function KeyPicker:OnChanged(Callback)
KeyPicker.Changed = Callback
Callback(KeyPicker.Value)
end
if ParentObj.Addons then
table.insert(ParentObj.Addons, KeyPicker)
end
function KeyPicker:DoClick()
if ParentObj.Type == 'Toggle' and KeyPicker.SyncToggleState then
ParentObj:SetValue(not ParentObj.Value)
end
Library:SafeCallback(KeyPicker.Callback, KeyPicker.Toggled)
Library:SafeCallback(KeyPicker.Clicked, KeyPicker.Toggled)
end
function KeyPicker:SetModePickerVisibility(bool)
ModeSelectOuter.Visible = bool;
end
function KeyPicker:GetModePickerVisibility()
return ModeSelectOuter.Visible;
end
PickOuter.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 and not
Library:MouseIsOverOpenedFrame() then
Picking = true;
DisplayLabel.Text = '';
local Break;
local Text = '';
task.spawn(function()
while (not Break) do
if Text == '...' then
Text = '';
end;
task.wait(0.4);
end;
end);
task.wait(0.2);
local Event;
Event = InputService.InputBegan:Connect(function(Input)
local Key;
Break = true;
Picking = false;
DisplayLabel.Text = Key;
KeyPicker.Value = Key;
Library:SafeCallback(KeyPicker.ChangedCallback, Input.KeyCode
or Input.UserInputType)
Library:SafeCallback(KeyPicker.Changed, Input.KeyCode or
Input.UserInputType)
Library:AttemptSave();
Event:Disconnect();
end);
elseif Input.UserInputType == Enum.UserInputType.MouseButton2 and not
Library:MouseIsOverOpenedFrame() then
KeyPicker:SetModePickerVisibility(not
KeyPicker:GetModePickerVisibility())
end;
end)
Library:GiveSignal(InputService.InputBegan:Connect(function(Input)
if KeyPicker.Value == "Unknown" then return end
KeyPicker:Update();
end;
KeyPicker:SetModePickerVisibility(false);
end;
end;
end))
Library:GiveSignal(InputService.InputEnded:Connect(function(Input)
if (not Picking) then
KeyPicker:Update();
end;
end))
KeyPicker:Update();
KeyPicker.DisplayFrame = PickOuter
Options[Idx] = KeyPicker;
return self;
end;
BaseAddons.__index = Funcs;
BaseAddons.__namecall = function(Table, Key, ...)
return Funcs[Key](...);
end;
end;
do
local Funcs = {};
return Library:Create('Frame', {
BackgroundTransparency = 1;
Size = UDim2.new(1, 0, 0, Size);
Visible = typeof(Visible) ~= "boolean" and true or Visible;
ZIndex = 1;
Parent = Container;
});
end;
function Funcs:AddLabel(...)
local Data = {}
local Label = {
};
if Data.DoesWrap then
local Y = select(2, Library:GetTextBounds(Data.Text, Library.Font, 14,
Vector2.new(TextLabel.AbsoluteSize.X, math.huge)))
TextLabel.Size = UDim2.new(1, -4, 0, Y)
else
Library:Create('UIListLayout', {
Padding = UDim.new(0, 4);
FillDirection = Enum.FillDirection.Horizontal;
HorizontalAlignment = Enum.HorizontalAlignment.Right;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = TextLabel;
});
end
Label.TextLabel = TextLabel;
Label.Container = Container;
function Label:SetText(Text)
TextLabel.Text = Text
if Data.DoesWrap then
local Y = select(2, Library:GetTextBounds(Text, Library.Font, 14,
Vector2.new(TextLabel.AbsoluteSize.X, math.huge)))
TextLabel.Size = UDim2.new(1, -4, 0, Y)
end
Groupbox:Resize();
end
if Data.Idx then
Options[Data.Idx] = Label;
end
return Label;
end;
function Funcs:AddButton(...)
local Button = typeof(select(1, ...)) == "table" and select(1, ...) or {
Text = select(1, ...),
Func = select(2, ...)
}
Library:Create('UIGradient', {
Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
});
Rotation = 90;
Parent = Inner;
});
Library:AddToRegistry(Outer, {
BorderColor3 = 'Black';
});
Library:AddToRegistry(Inner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
Library:OnHighlight(Outer, Outer,
{ BorderColor3 = 'AccentColor' },
{ BorderColor3 = 'Black' }
);
Button.Outer.InputBegan:Connect(function(Input)
if not ValidateClick(Input) then return end
if Button.Locked then return end
if Button.DoubleClick then
Library:RemoveFromRegistry(Button.Label)
Library:AddToRegistry(Button.Label, { TextColor3 =
'AccentColor' })
Button.Label.TextColor3 = Library.AccentColor
Button.Label.Text = 'Are you sure?'
Button.Locked = true
Library:RemoveFromRegistry(Button.Label)
Library:AddToRegistry(Button.Label, { TextColor3 =
'FontColor' })
Button.Label.TextColor3 = Library.FontColor
Button.Label.Text = Button.Text
task.defer(rawset, Button, 'Locked', false)
if clicked then
Library:SafeCallback(Button.Func)
end
return
end
Library:SafeCallback(Button.Func);
end)
end
InitEvents(Button)
function Button:AddTooltip(tooltip)
if typeof(tooltip) == 'string' then
Library:AddToolTip(tooltip, self.Outer)
end
return self
end
function Button:AddButton(...)
local SubButton = typeof(select(1, ...)) == "table" and select(1, ...)
or {
Text = select(1, ...),
Func = select(2, ...)
}
SubButton.Outer.Position = UDim2.new(1, 3, 0, 0)
SubButton.Outer.Size = UDim2.new(1, -3, 1, 0)--
UDim2.fromOffset(self.Outer.AbsoluteSize.X - 2, self.Outer.AbsoluteSize.Y)
SubButton.Outer.Parent = self.Outer
function SubButton:AddTooltip(tooltip)
if typeof(tooltip) == 'string' then
Library:AddToolTip(tooltip, self.Outer)
end
return SubButton
end
InitEvents(SubButton)
return SubButton
end
function Button:SetVisible(Visibility)
IsVisible = Visibility;
Button.Outer.Visible = IsVisible;
if Blank then Blank.Visible = IsVisible end;
Groupbox:Resize();
end;
return Button;
end;
function Funcs:AddDivider()
local Groupbox = self;
local Container = self.Container
local Divider = {
Type = 'Divider',
}
Groupbox:AddBlank(2);
local DividerOuter = Library:Create('Frame', {
BackgroundColor3 = Color3.new(0, 0, 0);
BorderColor3 = Color3.new(0, 0, 0);
Size = UDim2.new(1, -4, 0, 5);
ZIndex = 5;
Parent = Container;
});
Library:AddToRegistry(DividerInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
Groupbox:AddBlank(9);
Groupbox:Resize();
end
local Textbox = {
Value = Info.Default or '';
Numeric = Info.Numeric or false;
Finished = Info.Finished or false;
Type = 'Input';
Callback = Info.Callback or function(Value) end;
};
Groupbox:AddBlank(1);
Library:AddToRegistry(TextBoxInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
Library:OnHighlight(TextBoxOuter, TextBoxOuter,
{ BorderColor3 = 'AccentColor' },
{ BorderColor3 = 'Black' }
);
Library:Create('UIGradient', {
Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
});
Rotation = 90;
Parent = TextBoxInner;
});
ZIndex = 7;
Parent = TextBoxInner;
})
Font = Library.Font;
PlaceholderColor3 = Color3.fromRGB(190, 190, 190);
PlaceholderText = Info.Placeholder or '';
ZIndex = 7;
Parent = Container;
});
Library:ApplyTextStroke(Box);
function Textbox:SetValue(Text)
if Info.MaxLength and #Text > Info.MaxLength then
Text = Text:sub(1, Info.MaxLength);
end;
if Textbox.Numeric then
if (not tonumber(Text)) and Text:len() > 0 then
Text = Textbox.Value
end
end
Textbox.Value = Text;
Box.Text = Text;
Library:SafeCallback(Textbox.Callback, Textbox.Value);
Library:SafeCallback(Textbox.Changed, Textbox.Value);
end;
if Textbox.Finished then
Box.FocusLost:Connect(function(enter)
if not enter then return end
Textbox:SetValue(Box.Text);
Library:AttemptSave();
end)
else
Box:GetPropertyChangedSignal('Text'):Connect(function()
Textbox:SetValue(Box.Text);
Library:AttemptSave();
end);
end
-- https://devforum.roblox.com/t/how-to-make-textboxes-follow-current-
cursor-position/1368429/6
-- thank you nicemike40 :)
-- adjust if necessary
if currentCursorPos < PADDING then
Box.Position = UDim2.fromOffset(PADDING-width, 0)
elseif currentCursorPos > reveal - PADDING - 1 then
Box.Position = UDim2.fromOffset(reveal-width-PADDING-1, 0)
end
end
end
end
task.spawn(Update)
Box:GetPropertyChangedSignal('Text'):Connect(Update)
Box:GetPropertyChangedSignal('CursorPosition'):Connect(Update)
Box.FocusLost:Connect(Update)
Box.Focused:Connect(Update)
Library:AddToRegistry(Box, {
TextColor3 = 'FontColor';
});
function Textbox:OnChanged(Func)
Textbox.Changed = Func;
Func(Textbox.Value);
end;
Groupbox:AddBlank(5);
Groupbox:Resize();
Options[Idx] = Textbox;
return Textbox;
end;
local Toggle = {
Value = Info.Default or false;
Type = 'Toggle';
Visible = typeof(Info.Visible) ~= "boolean" and true or Info.Visible;
local Blank;
local Groupbox = self;
local Container = Groupbox.Container;
Library:AddToRegistry(ToggleOuter, {
BorderColor3 = 'Black';
});
Library:AddToRegistry(ToggleInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
Library:Create('UIListLayout', {
Padding = UDim.new(0, 4);
FillDirection = Enum.FillDirection.Horizontal;
HorizontalAlignment = Enum.HorizontalAlignment.Right;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = ToggleLabel;
});
Library:OnHighlight(ToggleRegion, ToggleOuter,
{ BorderColor3 = 'AccentColor' },
{ BorderColor3 = 'Black' },
function()
for _, Addon in next, Toggle.Addons do
if Library:MouseIsOverFrame(Addon.DisplayFrame) then return
false end
end
return true
end
);
function Toggle:UpdateColors()
Toggle:Display();
end;
function Toggle:Display()
ToggleInner.BackgroundColor3 = Toggle.Value and Library.AccentColor or
Library.MainColor;
ToggleInner.BorderColor3 = Toggle.Value and Library.AccentColorDark or
Library.OutlineColor;
Library.RegistryMap[ToggleInner].Properties.BackgroundColor3 =
Toggle.Value and 'AccentColor' or 'MainColor';
Library.RegistryMap[ToggleInner].Properties.BorderColor3 = Toggle.Value
and 'AccentColorDark' or 'OutlineColor';
end;
function Toggle:OnChanged(Func)
Toggle.Changed = Func;
Func(Toggle.Value);
end;
function Toggle:SetValue(Bool)
Bool = (not not Bool);
Toggle.Value = Bool;
Toggle:Display();
Library:SafeCallback(Toggle.Callback, Toggle.Value);
Library:SafeCallback(Toggle.Changed, Toggle.Value);
Library:UpdateDependencyBoxes();
end;
function Toggle:SetVisible(Visibility)
Toggle.Visible = Visibility;
ToggleOuter.Visible = Toggle.Visible;
if Blank then Blank.Visible = Toggle.Visible end;
Groupbox:Resize();
end;
ToggleRegion.InputBegan:Connect(function(Input)
if (Input.UserInputType == Enum.UserInputType.MouseButton1 and not
Library:MouseIsOverOpenedFrame()) or Input.UserInputType ==
Enum.UserInputType.Touch then
for _, Addon in next, Toggle.Addons do
if Library:MouseIsOverFrame(Addon.DisplayFrame) then return end
end
Toggle:SetValue(not Toggle.Value) -- Why was it not like this from
the start?
Library:AttemptSave();
end;
end);
if Toggle.Risky then
Library:RemoveFromRegistry(ToggleLabel)
ToggleLabel.TextColor3 = Library.RiskColor
Library:AddToRegistry(ToggleLabel, { TextColor3 = 'RiskColor' })
end
Toggle:Display();
Blank = Groupbox:AddBlank(Info.BlankSize or 5 + 2, Toggle.Visible);
Groupbox:Resize();
Toggle.TextLabel = ToggleLabel;
Toggle.Container = Container;
setmetatable(Toggle, BaseAddons);
Toggles[Idx] = Toggle;
Library:UpdateDependencyBoxes();
return Toggle;
end;
local Slider = {
Value = Info.Default;
Min = Info.Min;
Max = Info.Max;
Rounding = Info.Rounding;
MaxSize = 232;
Type = 'Slider';
Visible = typeof(Info.Visible) ~= "boolean" and true or Info.Visible;
Callback = Info.Callback or function(Value) end;
};
SliderOuter:GetPropertyChangedSignal('AbsoluteSize'):Connect(function()
Slider.MaxSize = SliderOuter.AbsoluteSize.X - 2;
end);
Library:AddToRegistry(SliderOuter, {
BorderColor3 = 'Black';
});
Library:AddToRegistry(SliderInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
Library:AddToRegistry(Fill, {
BackgroundColor3 = 'AccentColor';
BorderColor3 = 'AccentColorDark';
});
Library:AddToRegistry(HideBorderRight, {
BackgroundColor3 = 'AccentColor';
});
Library:OnHighlight(SliderOuter, SliderOuter,
{ BorderColor3 = 'AccentColor' },
{ BorderColor3 = 'Black' }
);
function Slider:UpdateColors()
Fill.BackgroundColor3 = Library.AccentColor;
Fill.BorderColor3 = Library.AccentColorDark;
end;
function Slider:Display()
local Suffix = Info.Suffix or '';
if Info.Compact then
DisplayLabel.Text = Info.Text .. ': ' .. Slider.Value .. Suffix
elseif Info.HideMax then
DisplayLabel.Text = string.format('%s', Slider.Value .. Suffix)
else
DisplayLabel.Text = string.format('%s/%s', Slider.Value .. Suffix,
Slider.Max .. Suffix);
end
function Slider:OnChanged(Func)
Slider.Changed = Func;
Func(Slider.Value);
end;
function Slider:GetValueFromXScale(X)
return Round(Library:MapValue(X, 0, 1, Slider.Min, Slider.Max));
end;
function Slider:SetMax(Value)
assert(Value > Slider.Min, 'Max value cannot be less than the current
min value.');
function Slider:SetMin(Value)
assert(Value < Slider.Max, 'Min value cannot be greater than the
current max value.');
function Slider:SetValue(Str)
local Num = tonumber(Str);
Slider.Value = Num;
Slider:Display();
Library:SafeCallback(Slider.Callback, Slider.Value);
Library:SafeCallback(Slider.Changed, Slider.Value);
end;
function Slider:SetVisible(Visibility)
Slider.Visible = Visibility;
Groupbox:Resize();
end;
SliderInner.InputBegan:Connect(function(Input)
if (Input.UserInputType == Enum.UserInputType.MouseButton1 and not
Library:MouseIsOverOpenedFrame()) or Input.UserInputType ==
Enum.UserInputType.Touch then
if Library.IsMobile then
Library.CanDrag = false;
end;
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1 or
Enum.UserInputType.Touch) do
local nMPos = Mouse.X;
local nXOffset = math.clamp(gPos + (nMPos - mPos) + Diff, 0,
Slider.MaxSize); -- what in tarnation are these variable names
local nXScale = Library:MapValue(nXOffset, 0, Slider.MaxSize,
0, 1);
Slider:Display();
RenderStepped:Wait();
end;
if Library.IsMobile then
Library.CanDrag = true;
end;
Library:AttemptSave();
end;
end);
Slider:Display();
table.insert(Blanks, Groupbox:AddBlank(Info.BlankSize or 6,
Slider.Visible));
Groupbox:Resize();
Options[Idx] = Slider;
return Slider;
end;
local Dropdown = {
Values = Info.Values;
Value = Info.Multi and {};
Multi = Info.Multi;
Type = 'Dropdown';
SpecialType = Info.SpecialType; -- can be either 'Player' or 'Team'
Visible = typeof(Info.Visible) ~= "boolean" and true or Info.Visible;
Callback = Info.Callback or function(Value) end;
};
local DropdownLabel;
local Blank;
local CompactBlank;
local Groupbox = self;
local Container = Groupbox.Container;
local RelativeOffset = 0;
Library:AddToRegistry(DropdownOuter, {
BorderColor3 = 'Black';
});
Library:AddToRegistry(DropdownInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
Library:Create('UIGradient', {
Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
});
Rotation = 90;
Parent = DropdownInner;
});
Library:OnHighlight(DropdownOuter, DropdownOuter,
{ BorderColor3 = 'AccentColor' },
{ BorderColor3 = 'Black' }
);
RecalculateListPosition();
RecalculateListSize();
DropdownOuter:GetPropertyChangedSignal('AbsolutePosition'):Connect(RecalculateListP
osition);
Library:AddToRegistry(ListInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
TopImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png',
BottomImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png',
ScrollBarThickness = 3,
ScrollBarImageColor3 = Library.AccentColor,
});
Library:AddToRegistry(Scrolling, {
ScrollBarImageColor3 = 'AccentColor'
})
Library:Create('UIListLayout', {
Padding = UDim.new(0, 0);
FillDirection = Enum.FillDirection.Vertical;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = Scrolling;
});
function Dropdown:Display()
local Values = Dropdown.Values;
local Str = '';
if Info.Multi then
for Idx, Value in next, Values do
if Dropdown.Value[Value] then
Str = Str .. Value .. ', ';
end;
end;
function Dropdown:GetActiveValues()
if Info.Multi then
local T = {};
return T;
else
return Dropdown.Value and 1 or 0;
end;
end;
function Dropdown:BuildDropdownList()
local Values = Dropdown.Values;
local Buttons = {};
local Count = 0;
for Idx, Value in next, Values do
local Table = {};
Count = Count + 1;
local Button = Library:Create('Frame', {
BackgroundColor3 = Library.MainColor;
BorderColor3 = Library.OutlineColor;
BorderMode = Enum.BorderMode.Middle;
Size = UDim2.new(1, -1, 0, 20);
ZIndex = 23;
Active = true,
Parent = Scrolling;
});
Library:AddToRegistry(Button, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
Library:OnHighlight(Button, Button,
{ BorderColor3 = 'AccentColor', ZIndex = 24 },
{ BorderColor3 = 'OutlineColor', ZIndex = 23 }
);
local Selected;
if Info.Multi then
Selected = Dropdown.Value[Value];
else
Selected = Dropdown.Value == Value;
end;
function Table:UpdateButton()
if Info.Multi then
Selected = Dropdown.Value[Value];
else
Selected = Dropdown.Value == Value;
end;
ButtonLabel.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or
Input.UserInputType == Enum.UserInputType.Touch then
local Try = not Selected;
if Selected then
Dropdown.Value[Value] = true;
else
Dropdown.Value[Value] = nil;
end;
else
Selected = Try;
if Selected then
Dropdown.Value = Value;
else
Dropdown.Value = nil;
end;
Table:UpdateButton();
Dropdown:Display();
Library:UpdateDependencyBoxes();
Library:SafeCallback(Dropdown.Callback,
Dropdown.Value);
Library:SafeCallback(Dropdown.Changed, Dropdown.Value);
Library:AttemptSave();
end;
end;
end);
Table:UpdateButton();
Dropdown:Display();
Buttons[Button] = Table;
end;
-- Workaround for silly roblox bug - not sure why it happens but
sometimes the dropdown list will be empty
-- ... and for some reason refreshing the Visible property fixes the
issue??????? thanks roblox!
Scrolling.Visible = false;
Scrolling.Visible = true;
function Dropdown:SetValues(NewValues)
if NewValues then
Dropdown.Values = NewValues;
end;
Dropdown:BuildDropdownList();
end;
function Dropdown:SetVisible(Visibility)
Dropdown.Visible = Visibility;
DropdownOuter.Visible = Dropdown.Visible;
if DropdownLabel then DropdownLabel.Visible = Dropdown.Visible end;
if Blank then Blank.Visible = Dropdown.Visible end;
if CompactBlank then CompactBlank.Visible = Dropdown.Visible end;
if not Dropdown.Visible then Dropdown:CloseDropdown() end;
Groupbox:Resize();
end;
function Dropdown:OpenDropdown()
if Library.IsMobile then
Library.CanDrag = false;
end;
ListOuter.Visible = true;
Library.OpenedFrames[ListOuter] = true;
DropdownArrow.Rotation = 180;
RecalculateListSize();
end;
function Dropdown:CloseDropdown()
if Library.IsMobile then
Library.CanDrag = true;
end;
ListOuter.Visible = false;
Library.OpenedFrames[ListOuter] = nil;
DropdownArrow.Rotation = 0;
end;
function Dropdown:OnChanged(Func)
Dropdown.Changed = Func;
Func(Dropdown.Value);
end;
function Dropdown:SetValue(Val)
if Dropdown.Multi then
local nTable = {};
Dropdown.Value = nTable;
else
if (not Val) then
Dropdown.Value = nil;
elseif table.find(Dropdown.Values, Val) then
Dropdown.Value = Val;
end;
end;
Dropdown:BuildDropdownList();
Library:SafeCallback(Dropdown.Callback, Dropdown.Value);
Library:SafeCallback(Dropdown.Changed, Dropdown.Value);
end;
DropdownOuter.InputBegan:Connect(function(Input)
if (Input.UserInputType == Enum.UserInputType.MouseButton1 and not
Library:MouseIsOverOpenedFrame()) or Input.UserInputType ==
Enum.UserInputType.Touch then
if ListOuter.Visible then
Dropdown:CloseDropdown();
else
Dropdown:OpenDropdown();
end;
end;
end);
InputService.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or
Input.UserInputType == Enum.UserInputType.Touch then
local AbsPos, AbsSize = ListOuter.AbsolutePosition,
ListOuter.AbsoluteSize;
Dropdown:CloseDropdown();
end;
end;
end);
Dropdown:BuildDropdownList();
Dropdown:Display();
local Defaults = {}
Dropdown:BuildDropdownList();
Dropdown:Display();
end
Options[Idx] = Dropdown;
return Dropdown;
end;
function Funcs:AddDependencyBox()
local Depbox = {
Dependencies = {};
};
function Depbox:Resize()
Holder.Size = UDim2.new(1, 0, 0, Layout.AbsoluteContentSize.Y);
Groupbox:Resize();
end;
Layout:GetPropertyChangedSignal('AbsoluteContentSize'):Connect(function()
Depbox:Resize();
end);
Holder:GetPropertyChangedSignal('Visible'):Connect(function()
Depbox:Resize();
end);
function Depbox:Update()
for _, Dependency in next, Depbox.Dependencies do
local Elem = Dependency[1];
local Value = Dependency[2];
Holder.Visible = true;
Depbox:Resize();
end;
function Depbox:SetupDependencies(Dependencies)
for _, Dependency in next, Dependencies do
assert(typeof(Dependency) == 'table', 'SetupDependencies:
Dependency is not of type `table`.');
assert(Dependency[1], 'SetupDependencies: Dependency is missing
element argument.');
assert(Dependency[2] ~= nil, 'SetupDependencies: Dependency is
missing value argument.');
end;
Depbox.Dependencies = Dependencies;
Depbox:Update();
end;
Depbox.Container = Frame;
setmetatable(Depbox, BaseGroupbox);
table.insert(Library.DependencyBoxes, Depbox);
return Depbox;
end;
BaseGroupbox.__index = Funcs;
BaseGroupbox.__namecall = function(Table, Key, ...)
return Funcs[Key](...);
end;
end;
Library:Create('UIListLayout', {
Padding = UDim.new(0, 4);
FillDirection = Enum.FillDirection.Vertical;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = Library.LeftNotificationArea;
});
Library.RightNotificationArea = Library:Create('Frame', {
AnchorPoint = Vector2.new(1, 0);
BackgroundTransparency = 1;
Position = UDim2.new(1, 0, 0, 40);
Size = UDim2.new(0, 300, 0, 200);
ZIndex = 100;
Parent = ScreenGui;
});
Library:Create('UIListLayout', {
Padding = UDim.new(0, 4);
FillDirection = Enum.FillDirection.Vertical;
HorizontalAlignment = Enum.HorizontalAlignment.Right;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = Library.RightNotificationArea;
});
Library:AddToRegistry(WatermarkInner, {
BorderColor3 = 'AccentColor';
});
Library:AddToRegistry(Gradient, {
Color = function()
return ColorSequence.new({
ColorSequenceKeypoint.new(0,
Library:GetDarkerColor(Library.MainColor)),
ColorSequenceKeypoint.new(1, Library.MainColor),
});
end
});
Library.Watermark = WatermarkOuter;
Library.WatermarkText = WatermarkLabel;
Library:MakeDraggable(Library.Watermark);
Library:AddToRegistry(KeybindInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
}, true);
Library:AddToRegistry(ColorFrame, {
BackgroundColor3 = 'AccentColor';
}, true);
Text = 'Keybinds';
ZIndex = 104;
Parent = KeybindInner;
});
Library:MakeDraggable(KeybindOuter);
Library:Create('UIListLayout', {
FillDirection = Enum.FillDirection.Vertical;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = KeybindContainer;
});
Library:Create('UIPadding', {
PaddingLeft = UDim.new(0, 5),
Parent = KeybindContainer,
})
Library.KeybindFrame = KeybindOuter;
Library.KeybindContainer = KeybindContainer;
Library:MakeDraggable(KeybindOuter);
end;
function Library:SetWatermarkVisibility(Bool)
Library.Watermark.Visible = Bool;
end;
function Library:SetWatermark(Text)
local X, Y = Library:GetTextBounds(Text, Library.Font, 14);
Library.Watermark.Size = UDim2.new(0, X + 15, 0, (Y * 1.5) + 3);
Library:SetWatermarkVisibility(true)
Library.WatermarkText.Text = Text;
end;
YSize = YSize + 7
Library:AddToRegistry(NotifyInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
}, true);
Library:AddToRegistry(Gradient, {
Color = function()
return ColorSequence.new({
ColorSequenceKeypoint.new(0,
Library:GetDarkerColor(Library.MainColor)),
ColorSequenceKeypoint.new(1, Library.MainColor),
});
end
});
Library:AddToRegistry(SideColor, {
BackgroundColor3 = 'AccentColor';
}, true);
if SoundId then
Library:Create('Sound', {
SoundId = "rbxassetid://" .. tostring(SoundId):gsub("rbxassetid://",
"");
Volume = 3;
PlayOnRemove = true;
Parent = game:GetService("SoundService");
}):Destroy();
end
task.spawn(function()
if typeof(Time) == "Instance" then
Time.Destroying:Wait();
else
task.wait(Time or 5);
end
task.wait(0.4);
NotifyOuter:Destroy();
end);
end;
YSize = YSize + 7
Library:AddToRegistry(NotifyInner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
}, true);
Library:AddToRegistry(Gradient, {
Color = function()
return ColorSequence.new({
ColorSequenceKeypoint.new(0,
Library:GetDarkerColor(Library.MainColor)),
ColorSequenceKeypoint.new(1, Library.MainColor),
});
end
});
Library:AddToRegistry(SideColor, {
BackgroundColor3 = 'AccentColor';
}, true);
if SoundId then
Library:Create('Sound', {
SoundId = "rbxassetid://" .. tostring(SoundId):gsub("rbxassetid://",
"");
Volume = 3;
PlayOnRemove = true;
Parent = game:GetService("SoundService");
}):Destroy();
end
task.spawn(function()
if typeof(Time) == "Instance" then
Time.Destroying:Wait();
else
task.wait(Time or 5);
end
task.wait(0.4);
NotifyOuter:Destroy();
end);
end;
function Library:CreateWindow(...)
local Arguments = { ... }
local Config = { AnchorPoint = Vector2.zero }
if Config.Center then
-- Config.AnchorPoint = Vector2.new(0.5, 0.5)
Config.Position = UDim2.new(0.5, -Config.Size.X.Offset/2, 0.5, -
Config.Size.Y.Offset/2)
end
local Window = {
Tabs = {};
};
if Config.Resizable then
Library:MakeResizable(Outer, Library.MinSize);
end
Library:AddToRegistry(Inner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'AccentColor';
});
Library:AddToRegistry(MainSectionOuter, {
BackgroundColor3 = 'BackgroundColor';
BorderColor3 = 'OutlineColor';
});
Library:AddToRegistry(MainSectionInner, {
BackgroundColor3 = 'BackgroundColor';
});
Library:Create('Frame', {
BackgroundColor3 = Library.BackgroundColor;
BorderColor3 = Library.OutlineColor;
Size = UDim2.new(0, 0, 0, 0);
LayoutOrder = -1;
BackgroundTransparency = 1;
ZIndex = 1;
Parent = TabArea;
});
Library:Create('Frame', {
BackgroundColor3 = Library.BackgroundColor;
BorderColor3 = Library.OutlineColor;
Size = UDim2.new(0, 0, 0, 0);
LayoutOrder = 9999999;
BackgroundTransparency = 1;
ZIndex = 1;
Parent = TabArea;
});
Library:AddToRegistry(TabContainer, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'OutlineColor';
});
function Window:SetWindowTitle(Title)
WindowLabel.Text = Title;
end;
function Window:AddTab(Name)
local Tab = {
Groupboxes = {};
Tabboxes = {};
};
Library:AddToRegistry(TabButton, {
BackgroundColor3 = 'BackgroundColor';
BorderColor3 = 'OutlineColor';
});
Library:AddToRegistry(Blocker, {
BackgroundColor3 = 'MainColor';
});
TopBarInner = Library:Create('Frame', {
BackgroundColor3 = Color3.fromRGB(117, 22, 17);
BorderColor3 = Color3.new();
-- BorderMode = Enum.BorderMode.Inset;
Size = UDim2.new(1, -2, 1, -2);
Position = UDim2.new(0, 1, 0, 1);
ZIndex = 4;
Parent = TopBar;
});
TopBarLabel = Library:Create('TextLabel', {
BackgroundTransparency = 1;
Font = Library.Font;
TextStrokeTransparency = 0;
TopBarTextLabel = Library:CreateLabel({
Position = UDim2.new(0, 4, 0, 20);
Size = UDim2.new(1, -4, 0, 14);
TextSize = 14;
Text = "Text";
TextWrapped = true,
TextXAlignment = Enum.TextXAlignment.Left;
TextYAlignment = Enum.TextYAlignment.Top;
ZIndex = 5;
Parent = TopBarInner;
});
Library:Create('Frame', {
BackgroundTransparency = 1;
Size = UDim2.new(1, 0, 0, 5);
Visible = true;
ZIndex = 1;
Parent = TopBarInner;
});
end
Library:Create('UIListLayout', {
Padding = UDim.new(0, 8);
FillDirection = Enum.FillDirection.Vertical;
SortOrder = Enum.SortOrder.LayoutOrder;
HorizontalAlignment = Enum.HorizontalAlignment.Center;
Parent = LeftSide;
});
Library:Create('UIListLayout', {
Padding = UDim.new(0, 8);
FillDirection = Enum.FillDirection.Vertical;
SortOrder = Enum.SortOrder.LayoutOrder;
HorizontalAlignment = Enum.HorizontalAlignment.Center;
Parent = RightSide;
});
if Library.IsMobile then
local SidesValues = {
["Left"] = tick(),
["Right"] = tick(),
}
LeftSide:GetPropertyChangedSignal('CanvasPosition'):Connect(function()
Library.CanDrag = false;
RightSide:GetPropertyChangedSignal('CanvasPosition'):Connect(function()
Library.CanDrag = false;
Side:WaitForChild('UIListLayout'):GetPropertyChangedSignal('AbsoluteContentSize'):C
onnect(function()
Side.CanvasSize = UDim2.fromOffset(0,
Side.UIListLayout.AbsoluteContentSize.Y);
end);
end;
function Tab:Resize()
if TopBar.Visible == true then
local Size = 5;
function Tab:UpdateWarningBox(Info)
if typeof(Info.Visible) == "boolean" then
TopBar.Visible = Info.Visible;
Tab:Resize();
end;
Tab:Resize();
end;
end;
function Tab:ShowTab()
Library.ActiveTab = Name;
for _, Tab in next, Window.Tabs do
Tab:HideTab();
end;
Blocker.BackgroundTransparency = 0;
TabButton.BackgroundColor3 = Library.MainColor;
Library.RegistryMap[TabButton].Properties.BackgroundColor3 =
'MainColor';
TabFrame.Visible = true;
Tab:Resize();
end;
function Tab:HideTab()
Blocker.BackgroundTransparency = 1;
TabButton.BackgroundColor3 = Library.BackgroundColor;
Library.RegistryMap[TabButton].Properties.BackgroundColor3 =
'BackgroundColor';
TabFrame.Visible = false;
end;
function Tab:SetLayoutOrder(Position)
TabButton.LayoutOrder = Position;
TabListLayout:ApplyLayout();
end;
function Tab:GetSides()
return { ["Left"] = LeftSide, ["Right"] = RightSide };
end;
function Tab:AddGroupbox(Info)
local Groupbox = {};
local BoxOuter = Library:Create('Frame', {
BackgroundColor3 = Library.BackgroundColor;
BorderColor3 = Library.OutlineColor;
BorderMode = Enum.BorderMode.Inset;
Size = UDim2.new(1, 0, 0, 507 + 2);
ZIndex = 2;
Parent = Info.Side == 1 and LeftSide or RightSide;
});
Library:AddToRegistry(BoxOuter, {
BackgroundColor3 = 'BackgroundColor';
BorderColor3 = 'OutlineColor';
});
Library:AddToRegistry(BoxInner, {
BackgroundColor3 = 'BackgroundColor';
});
Library:AddToRegistry(Highlight, {
BackgroundColor3 = 'AccentColor';
});
Library:Create('UIListLayout', {
FillDirection = Enum.FillDirection.Vertical;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = Container;
});
function Groupbox:Resize()
local Size = 0;
Groupbox.Container = Container;
setmetatable(Groupbox, BaseGroupbox);
Groupbox:AddBlank(3);
Groupbox:Resize();
Tab.Groupboxes[Info.Name] = Groupbox;
return Groupbox;
end;
function Tab:AddLeftGroupbox(Name)
return Tab:AddGroupbox({ Side = 1; Name = Name; });
end;
function Tab:AddRightGroupbox(Name)
return Tab:AddGroupbox({ Side = 2; Name = Name; });
end;
function Tab:AddTabbox(Info)
local Tabbox = {
Tabs = {};
};
Library:AddToRegistry(BoxOuter, {
BackgroundColor3 = 'BackgroundColor';
BorderColor3 = 'OutlineColor';
});
Library:AddToRegistry(BoxInner, {
BackgroundColor3 = 'BackgroundColor';
});
Library:AddToRegistry(Highlight, {
BackgroundColor3 = 'AccentColor';
});
Library:Create('UIListLayout', {
FillDirection = Enum.FillDirection.Horizontal;
HorizontalAlignment = Enum.HorizontalAlignment.Left;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = TabboxButtons;
});
function Tabbox:AddTab(Name)
local Tab = {};
Library:AddToRegistry(Button, {
BackgroundColor3 = 'MainColor';
});
Library:AddToRegistry(Block, {
BackgroundColor3 = 'BackgroundColor';
});
Library:Create('UIListLayout', {
FillDirection = Enum.FillDirection.Vertical;
SortOrder = Enum.SortOrder.LayoutOrder;
Parent = Container;
});
function Tab:Show()
for _, Tab in next, Tabbox.Tabs do
Tab:Hide();
end;
Container.Visible = true;
Block.Visible = true;
Button.BackgroundColor3 = Library.BackgroundColor;
Library.RegistryMap[Button].Properties.BackgroundColor3 =
'BackgroundColor';
Tab:Resize();
end;
function Tab:Hide()
Container.Visible = false;
Block.Visible = false;
Button.BackgroundColor3 = Library.MainColor;
Library.RegistryMap[Button].Properties.BackgroundColor3 =
'MainColor';
end;
function Tab:Resize()
local TabCount = 0;
local Size = 0;
Button.InputBegan:Connect(function(Input)
if (Input.UserInputType == Enum.UserInputType.MouseButton1 and
not Library:MouseIsOverOpenedFrame()) or Input.UserInputType ==
Enum.UserInputType.Touch then
Tab:Show();
Tab:Resize();
end;
end)
Tab.Container = Container;
Tabbox.Tabs[Name] = Tab;
setmetatable(Tab, BaseGroupbox);
Tab:AddBlank(3);
Tab:Resize();
return Tab;
end;
return Tabbox;
end;
function Tab:AddLeftTabbox(Name)
return Tab:AddTabbox({ Name = Name, Side = 1; });
end;
function Tab:AddRightTabbox(Name)
return Tab:AddTabbox({ Name = Name, Side = 2; });
end;
TabButton.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or
Input.UserInputType == Enum.UserInputType.Touch then
Tab:ShowTab();
end;
end);
TopBar:GetPropertyChangedSignal("Visible"):Connect(function()
Tab:Resize();
end);
Window.Tabs[Name] = Tab;
return Tab;
end;
function Library:Toggle()
if Fading then return end;
if Toggled then
-- A bit scuffed, but if we're going from not toggled -> toggled we
want to show the frame immediately so that the fade is visible.
Outer.Visible = true;
if Desc:IsA('ImageLabel') then
table.insert(Properties, 'ImageTransparency');
table.insert(Properties, 'BackgroundTransparency');
elseif Desc:IsA('TextLabel') or Desc:IsA('TextBox') then
table.insert(Properties, 'TextTransparency');
elseif Desc:IsA('Frame') or Desc:IsA('ScrollingFrame') then
table.insert(Properties, 'BackgroundTransparency');
elseif Desc:IsA('UIStroke') then
table.insert(Properties, 'Transparency');
end;
if Cache[Prop] == 1 then
continue;
end;
TweenService:Create(Desc, TweenInfo.new(FadeTime,
Enum.EasingStyle.Linear), { [Prop] = Toggled and Cache[Prop] or 1 }):Play();
end;
end;
task.wait(FadeTime);
Outer.Visible = Toggled;
Fading = false;
end
Library:GiveSignal(InputService.InputBegan:Connect(function(Input, Processed)
if typeof(Library.ToggleKeybind) == 'table' and Library.ToggleKeybind.Type
== 'KeyPicker' then
if Input.UserInputType == Enum.UserInputType.Keyboard and
Input.KeyCode.Name == Library.ToggleKeybind.Value then
task.spawn(Library.Toggle)
end
elseif Input.KeyCode == Enum.KeyCode.RightControl or (Input.KeyCode ==
Enum.KeyCode.RightShift and (not Processed)) then
task.spawn(Library.Toggle)
end
end));
if Library.IsMobile then
local ToggleUIOuter = Library:Create('Frame', {
BorderColor3 = Color3.new(0, 0, 0);
Position = UDim2.new(0.008, 0, 0.018, 0);
Size = UDim2.new(0, 77, 0, 30);
ZIndex = 200;
Visible = true;
Parent = ScreenGui;
});
Library:AddToRegistry(ToggleUIGradient, {
Color = function()
return ColorSequence.new({
ColorSequenceKeypoint.new(0,
Library:GetDarkerColor(Library.MainColor)),
ColorSequenceKeypoint.new(1, Library.MainColor),
});
end
});
Library:MakeDraggableUsingParent(ToggleUIButton, ToggleUIOuter);
ToggleUIButton.MouseButton1Down:Connect(function()
Library:Toggle()
end)
-- Lock
local LockUIOuter = Library:Create('Frame', {
BorderColor3 = Color3.new(0, 0, 0);
Position = UDim2.new(0.008, 0, 0.075, 0);
Size = UDim2.new(0, 77, 0, 30);
ZIndex = 200;
Visible = true;
Parent = ScreenGui;
});
Library:AddToRegistry(LockUIInner, {
BorderColor3 = 'AccentColor';
});
Library:AddToRegistry(LockUIGradient, {
Color = function()
return ColorSequence.new({
ColorSequenceKeypoint.new(0,
Library:GetDarkerColor(Library.MainColor)),
ColorSequenceKeypoint.new(1, Library.MainColor),
});
end
});
Library:MakeDraggableUsingParent(LockUIButton, LockUIOuter);
LockUIButton.MouseButton1Down:Connect(function()
Library.CantDragForced = not Library.CantDragForced;
LockUIButton.Text = Library.CantDragForced and "Unlock UI" or "Lock
UI";
end)
end;
Window.Holder = Outer;
Library.Window = Window;
return Window;
end;
Library:GiveSignal(Players.PlayerAdded:Connect(OnPlayerChange));
Library:GiveSignal(Players.PlayerRemoving:Connect(OnPlayerChange));
getgenv().Library = Library
return Library