Ts 2
Ts 2
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Global;
ScreenGui.Parent = CoreGui;
getgenv().Toggles = Toggles;
getgenv().Options = Options;
local Library = {
Registry = {};
RegistryMap = {};
HudRegistry = {};
OpenedFrames = {};
DependencyBoxes = {};
Signals = {};
ScreenGui = ScreenGui;
};
local RainbowStep = 0
local Hue = 0
table.insert(Library.Signals, RenderStepped:Connect(function(Delta)
RainbowStep = RainbowStep + Delta
Library.CurrentRainbowHue = Hue;
Library.CurrentRainbowColor = Color3.fromHSV(Hue, 0.8, 1);
end
end))
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;
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);
Instance.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 then
local ObjPos = Vector2.new(
Mouse.X - Instance.AbsolutePosition.X,
Mouse.Y - Instance.AbsolutePosition.Y
);
RenderStepped:Wait();
end;
end;
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)
end
HighlightInstance.MouseLeave:Connect(function()
local Reg = Library.RegistryMap[Instance];
function Library:MouseIsOverOpenedFrame()
for Frame, _ in next, Library.OpenedFrames do
local AbsPos, AbsSize = Frame.AbsolutePosition, Frame.AbsoluteSize;
return true;
end;
end;
end;
function Library:IsMouseOverFrame(Frame)
local AbsPos, AbsSize = Frame.AbsolutePosition, Frame.AbsoluteSize;
if Mouse.X >= AbsPos.X and Mouse.X <= AbsPos.X + AbsSize.X
and Mouse.Y >= AbsPos.Y and Mouse.Y <= AbsPos.Y + AbsSize.Y then
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.
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)
Library.OnUnload = 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 = type(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)
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()
self.Container.Visible = true
end
function ContextMenu:Hide()
self.Container.Visible = false
end
Library:OnHighlight(Button, Button,
{ TextColor3 = 'AccentColor' },
{ TextColor3 = 'FontColor' }
);
Button.InputBegan:Connect(function(Input)
if Input.UserInputType ~= Enum.UserInputType.MouseButton1 then
return
end
Callback()
end)
end
end
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;
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 then
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) 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 then
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) 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 Input.UserInputType == Enum.UserInputType.MouseButton1 and not
Library:MouseIsOverOpenedFrame() then
if PickerFrameOuter.Visible then
ColorPicker:Hide()
else
ContextMenu:Hide()
ColorPicker:Show()
end;
elseif Input.UserInputType == Enum.UserInputType.MouseButton2 and not
Library:MouseIsOverOpenedFrame() then
ContextMenu:Show()
ColorPicker:Hide()
end
end);
if TransparencyBoxInner then
TransparencyBoxInner.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 then
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
local MinX = TransparencyBoxInner.AbsolutePosition.X;
local MaxX = MinX + TransparencyBoxInner.AbsoluteSize.X;
local MouseX = math.clamp(Mouse.X, MinX, MaxX);
RenderStepped:Wait();
end;
Library:AttemptSave();
end;
end);
end;
Library:GiveSignal(InputService.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 then
local AbsPos, AbsSize = PickerFrameOuter.AbsolutePosition,
PickerFrameOuter.AbsoluteSize;
ColorPicker:Hide();
end;
ColorPicker:Display();
ColorPicker.DisplayFrame = DisplayFrame
Options[Idx] = ColorPicker;
return self;
end;
local KeyPicker = {
Value = Info.Default;
Toggled = false;
Mode = Info.Mode or 'Toggle'; -- Always, Toggle, Hold
Type = 'KeyPicker';
Callback = Info.Callback or function(Value) end;
ChangedCallback = Info.ChangedCallback or function(New) end;
SyncToggleState = Info.SyncToggleState or false;
};
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;
});
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;
ContainerLabel.Visible = true;
ContainerLabel.TextColor3 = State and Library.AccentColor or
Library.FontColor;
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;
ModeButtons[Mode]:Select();
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
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;
wait(0.4);
end;
end);
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
ModeSelectOuter.Visible = true;
end;
end);
Library:GiveSignal(InputService.InputBegan:Connect(function(Input)
if (not Picking) then
if KeyPicker.Mode == 'Toggle' then
local Key = KeyPicker.Value;
KeyPicker:Update();
end;
ModeSelectOuter.Visible = false;
end;
end;
end))
Library:GiveSignal(InputService.InputEnded:Connect(function(Input)
if (not Picking) then
KeyPicker:Update();
end;
end))
KeyPicker:Update();
Options[Idx] = KeyPicker;
return self;
end;
BaseAddons.__index = Funcs;
BaseAddons.__namecall = function(Table, Key, ...)
return Funcs[Key](...);
end;
end;
do
local Funcs = {};
function Funcs:AddBlank(Size)
local Groupbox = self;
local Container = Groupbox.Container;
Library:Create('Frame', {
BackgroundTransparency = 1;
Size = UDim2.new(1, 0, 0, Size);
ZIndex = 1;
Parent = Container;
});
end;
function Funcs:AddLabel(Text, DoesWrap)
local Label = {};
if 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)
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 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
Groupbox:AddBlank(5);
Groupbox:Resize();
return Label;
end;
function Funcs:AddButton(...)
-- TODO: Eventually redo this
local Button = {};
local function ProcessButtonParams(Class, Obj, ...)
local Props = select(1, ...)
if type(Props) == 'table' then
Obj.Text = Props.Text
Obj.Func = Props.Func
Obj.DoubleClick = Props.DoubleClick
Obj.Tooltip = Props.Tooltip
else
Obj.Text = select(1, ...)
Obj.Func = select(2, ...)
end
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' }
);
return true
end
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
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 type(tooltip) == 'string' then
Library:AddToolTip(tooltip, self.Outer)
end
return self
end
function Button:AddButton(...)
local SubButton = {}
SubButton.Outer.Position = UDim2.new(1, 3, 0, 0)
SubButton.Outer.Size = UDim2.fromOffset(self.Outer.AbsoluteSize.X - 2,
self.Outer.AbsoluteSize.Y)
SubButton.Outer.Parent = self.Outer
function SubButton:AddTooltip(tooltip)
if type(tooltip) == 'string' then
Library:AddToolTip(tooltip, self.Outer)
end
return SubButton
end
InitEvents(SubButton)
return SubButton
end
Groupbox:AddBlank(5);
Groupbox:Resize();
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(DividerOuter, {
BorderColor3 = 'Black';
});
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';
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 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;
ToggleRegion.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 and not
Library:MouseIsOverOpenedFrame() then
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();
Groupbox:AddBlank(Info.BlankSize or 5 + 2);
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';
Callback = Info.Callback or function(Value) 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:GetValueFromXOffset(X)
return Round(Library:MapValue(X, 0, Slider.MaxSize, Slider.Min,
Slider.Max));
end;
function Slider:SetValue(Str)
local Num = tonumber(Str);
if (not Num) then
return;
end;
Slider.Value = Num;
Slider:Display();
Library:SafeCallback(Slider.Callback, Slider.Value);
Library:SafeCallback(Slider.Changed, Slider.Value);
end;
SliderInner.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 and not
Library:MouseIsOverOpenedFrame() then
local mPos = Mouse.X;
local gPos = Fill.Size.X.Offset;
local Diff = mPos - (Fill.AbsolutePosition.X + gPos);
while
InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
local nMPos = Mouse.X;
local nX = math.clamp(gPos + (nMPos - mPos) + Diff, 0,
Slider.MaxSize);
Slider:Display();
RenderStepped:Wait();
end;
Library:AttemptSave();
end;
end);
Slider:Display();
Groupbox:AddBlank(Info.BlankSize or 6);
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'
Callback = Info.Callback or function(Value) end;
};
local RelativeOffset = 0;
Groupbox:AddBlank(3);
end
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' }
);
local MAX_DROPDOWN_ITEMS = 8;
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;
Count = Count + 1;
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 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:SafeCallback(Dropdown.Callback,
Dropdown.Value);
Library:SafeCallback(Dropdown.Changed, Dropdown.Value);
Library:AttemptSave();
end;
end;
end);
Table:UpdateButton();
Dropdown:Display();
Buttons[Button] = Table;
end;
function Dropdown:SetValues(NewValues)
if NewValues then
Dropdown.Values = NewValues;
end;
Dropdown:BuildDropdownList();
end;
function Dropdown:OpenDropdown()
ListOuter.Visible = true;
Library.OpenedFrames[ListOuter] = true;
DropdownArrow.Rotation = 180;
end;
function Dropdown:CloseDropdown()
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() then
if ListOuter.Visible then
Dropdown:CloseDropdown();
else
Dropdown:OpenDropdown();
end;
end;
end);
InputService.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 then
local AbsPos, AbsSize = ListOuter.AbsolutePosition,
ListOuter.AbsoluteSize;
Dropdown:CloseDropdown();
end;
end;
end);
Dropdown:BuildDropdownList();
Dropdown:Display();
local Defaults = {}
if type(Info.Default) == 'string' then
local Idx = table.find(Dropdown.Values, Info.Default)
if Idx then
table.insert(Defaults, Idx)
end
elseif type(Info.Default) == 'table' then
for _, Value in next, Info.Default do
local Idx = table.find(Dropdown.Values, Value)
if Idx then
table.insert(Defaults, Idx)
end
end
elseif type(Info.Default) == 'number' and Dropdown.Values[Info.Default] ~=
nil then
table.insert(Defaults, Info.Default)
end
if next(Defaults) then
for i = 1, #Defaults do
local Index = Defaults[i]
if Info.Multi then
Dropdown.Value[Dropdown.Values[Index]] = true
else
Dropdown.Value = Dropdown.Values[Index];
end
Dropdown:BuildDropdownList();
Dropdown:Display();
end
Groupbox:AddBlank(Info.BlankSize or 5);
Groupbox:Resize();
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(type(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.NotificationArea;
});
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: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;
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(LeftColor, {
BackgroundColor3 = 'AccentColor';
}, true);
task.spawn(function()
wait(Time or 5);
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.fromScale(0.5, 0.5)
end
local Window = {
Tabs = {};
};
Library:MakeDraggable(Outer, 25);
Library:AddToRegistry(Inner, {
BackgroundColor3 = 'MainColor';
BorderColor3 = 'AccentColor';
});
Library:AddToRegistry(MainSectionOuter, {
BackgroundColor3 = 'BackgroundColor';
BorderColor3 = 'OutlineColor';
});
Library:AddToRegistry(MainSectionInner, {
BackgroundColor3 = 'BackgroundColor';
});
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(Blocker, {
BackgroundColor3 = 'MainColor';
});
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;
});
Side:WaitForChild('UIListLayout'):GetPropertyChangedSignal('AbsoluteContentSize'):C
onnect(function()
Side.CanvasSize = UDim2.fromOffset(0,
Side.UIListLayout.AbsoluteContentSize.Y);
end);
end;
function Tab:ShowTab()
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;
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:AddGroupbox(Info)
local Groupbox = {};
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() 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 then
Tab:ShowTab();
end;
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;
task.spawn(function()
-- TODO: add cursor fade?
local State = InputService.MouseIconEnabled;
Cursor.Color = Library.AccentColor;
CursorOutline.PointA = Cursor.PointA;
CursorOutline.PointB = Cursor.PointB;
CursorOutline.PointC = Cursor.PointC;
RenderStepped:Wait();
end;
InputService.MouseIconEnabled = State;
Cursor:Remove();
CursorOutline:Remove();]]
end);
end;
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 type(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))
Window.Holder = Outer;
return Window;
end;
Players.PlayerAdded:Connect(OnPlayerChange);
Players.PlayerRemoving:Connect(OnPlayerChange);
getgenv().Library = Library
return Library
end
--//Variables
local Settings = {
Farms = {
MobFarm = false,
Selectedmob = "Frisker",
Position = 6,
TweenSpeed = 100,
Autoequip = false,
},
Teleports = {
Selectednpc = "",
},
Autoquest = {
Toggle = false,
Questboard = "MissionBoard 12",
Position = 6,
},
Shikaifight = {
Toggle = false,
Position = 6,
},
Adjfarm = {
Toggle = false,
Position = -8.7,
},
Closest = {
Toggle = false,
Position = -8,
Distance = 150,
},
Notifier = false,
Minigame = false,
Obby = false,
}
local attackremote =
game:GetService("ReplicatedStorage").Remotes.ServerCombatHandler
local mobTable = { "Fishbone", "Frisker", "LostSoul", "Jackal", "Shinigami",
"Menos", "Bawabawa", "Jidanbo" }
local RunService = game:GetService("RunService")
local NextFrame = RunService.Heartbeat
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local ForceStop = false
local npcTable = {}
local player = game.Players.LocalPlayer
local questTable = { "nothing" }
local name = player.Name
local modtable = {
15293648, --iqcs
30370774, --Rakutsu
83254134, --s9d
80916772, -- Jaleox
23977275, -- Tsumoe
82280601, -- Lipopss
83254134, -- s9d
1506296146, -- okhwan
606256561, -- Abaddonisu
18577857, -- DripMonger
4061168, -- Castalysts
1159863871, -- enraiton
432360403, -- sinfuldms
10712932, -- Yreol
20660983, -- H3mzz
83338597, -- LeafyRei
54066348, -- PioClean
25329898, -- Joochun
8925483, -- K1LLUAA
1161914,
3427072680, -- haniyura
57431326, -- Khaotxc
77857290, -- 4Data
4192362393, -- mitakamora
300780145, -- invictal
232346707, -- Drakos
59903508, --cartier361
400349, -- streak
194177872,
36989055, -- Minst_r
36710249, -- MassRelays
30370774,
}
--//ESP Settings--
--Settings--
local ESP = {
Enabled = false,
Boxes = false,
BoxShift = CFrame.new(0, -1.5, 0),
BoxSize = Vector3.new(4, 6, 0),
Color = Color3.fromRGB(255, 0, 0),
FaceCamera = false,
Names = false,
TeamColor = false,
Thickness = 2,
AttachShift = 1,
TeamMates = false,
Players = true,
--//ESP Variables
--Declarations--
local cam = workspace.CurrentCamera
local plrs = game:GetService("Players")
local plr = plrs.LocalPlayer
local mouse = plr:GetMouse()
local V3new = Vector3.new
local WorldToViewportPoint = cam.WorldToViewportPoint
--Functions--
local function Draw(obj, props)
local new = Drawing.new(obj)
props = props or {}
for i, v in pairs(props) do
new[i] = v
end
return new
end
function ESP:GetTeam(p)
local ov = self.Overrides.GetTeam
if ov then
return ov(p)
end
function ESP:IsTeamMate(p)
local ov = self.Overrides.IsTeamMate
if ov then
return ov(p)
end
function ESP:GetColor(obj)
local ov = self.Overrides.GetColor
if ov then
return ov(obj)
end
local p = self:GetPlrFromChar(obj)
return p and self.TeamColor and p.Team and p.Team.TeamColor.Color or
self.Color
end
function ESP:GetPlrFromChar(char)
local ov = self.Overrides.GetPlrFromChar
if ov then
return ov(char)
end
return plrs:GetPlayerFromCharacter(char)
end
function ESP:Toggle(bool)
self.Enabled = bool
if not bool then
for i, v in pairs(self.Objects) do
if v.Type == "Box" then --fov circle etc
if v.Temporary then
v:Remove()
else
for i, v in pairs(v.Components) do
v.Visible = false
end
end
end
end
end
end
function ESP:GetBox(obj)
return self.Objects[obj]
end
if options.Recursive then
parent.DescendantAdded:Connect(NewListener)
for i, v in pairs(parent:GetDescendants()) do
coroutine.wrap(NewListener)(v)
end
else
parent.ChildAdded:Connect(NewListener)
for i, v in pairs(parent:GetChildren()) do
coroutine.wrap(NewListener)(v)
end
end
end
local boxBase = {}
boxBase.__index = boxBase
function boxBase:Remove()
ESP.Objects[self.Object] = nil
for i, v in pairs(self.Components) do
v.Visible = false
v:Remove()
self.Components[i] = nil
end
end
function boxBase:Update()
if not self.PrimaryPart then
--warn("not supposed to print", self.Object)
return self:Remove()
end
local color
if ESP.Highlighted == self.Object then
color = ESP.HighlightColor
else
color = self.Color or self.ColorDynamic and self:ColorDynamic() or
ESP:GetColor(self.Object) or ESP.Color
end
local allow = true
if ESP.Overrides.UpdateAllow and not ESP.Overrides.UpdateAllow(self) then
allow = false
end
if self.Player and not ESP.TeamMates and ESP:IsTeamMate(self.Player) then
allow = false
end
if self.Player and not ESP.Players then
allow = false
end
if
self.IsEnabled
and (
type(self.IsEnabled) == "string" and not ESP[self.IsEnabled]
or type(self.IsEnabled) == "function" and not self:IsEnabled()
)
then
allow = false
end
if not workspace:IsAncestorOf(self.PrimaryPart) and not self.RenderInNil
then
allow = false
end
--calculations--
local cf = self.PrimaryPart.CFrame
if ESP.FaceCamera then
cf = CFrame.new(cf.p, cam.CFrame.p)
end
local size = self.Size
local locs = {
TopLeft = cf * ESP.BoxShift * CFrame.new(size.X / 2, size.Y / 2, 0),
TopRight = cf * ESP.BoxShift * CFrame.new(-size.X / 2, size.Y / 2, 0),
BottomLeft = cf * ESP.BoxShift * CFrame.new(size.X / 2, -size.Y / 2,
0),
BottomRight = cf * ESP.BoxShift * CFrame.new(-size.X / 2, -size.Y / 2,
0),
TagPos = cf * ESP.BoxShift * CFrame.new(0, size.Y / 2, 0),
Torso = cf * ESP.BoxShift,
}
if ESP.Boxes then
local TopLeft, Vis1 = WorldToViewportPoint(cam, locs.TopLeft.p)
local TopRight, Vis2 = WorldToViewportPoint(cam, locs.TopRight.p)
local BottomLeft, Vis3 = WorldToViewportPoint(cam, locs.BottomLeft.p)
local BottomRight, Vis4 = WorldToViewportPoint(cam, locs.BottomRight.p)
if self.Components.Quad then
if Vis1 or Vis2 or Vis3 or Vis4 then
self.Components.Quad.Visible = true
self.Components.Quad.PointA = Vector2.new(TopRight.X,
TopRight.Y)
self.Components.Quad.PointB = Vector2.new(TopLeft.X, TopLeft.Y)
self.Components.Quad.PointC = Vector2.new(BottomLeft.X,
BottomLeft.Y)
self.Components.Quad.PointD = Vector2.new(BottomRight.X,
BottomRight.Y)
self.Components.Quad.Color = color
else
self.Components.Quad.Visible = false
end
end
else
self.Components.Quad.Visible = false
end
if ESP.Names then
local TagPos, Vis5 = WorldToViewportPoint(cam, locs.TagPos.p)
if Vis5 then
self.Components.Name.Visible = true
self.Components.Name.Position = Vector2.new(TagPos.X, TagPos.Y)
self.Components.Name.Text = self.Name
self.Components.Name.Color = color
self.Components.Distance.Visible = true
self.Components.Distance.Position = Vector2.new(TagPos.X, TagPos.Y
+ 14)
self.Components.Distance.Text = math.floor((cam.CFrame.p -
cf.p).magnitude) .. "m away"
self.Components.Distance.Color = color
else
self.Components.Name.Visible = false
self.Components.Distance.Visible = false
end
else
self.Components.Name.Visible = false
self.Components.Distance.Visible = false
end
if ESP.Tracers then
local TorsoPos, Vis6 = WorldToViewportPoint(cam, locs.Torso.p)
if Vis6 then
self.Components.Tracer.Visible = true
self.Components.Tracer.From = Vector2.new(TorsoPos.X, TorsoPos.Y)
self.Components.Tracer.To = Vector2.new(cam.ViewportSize.X / 2,
cam.ViewportSize.Y / ESP.AttachShift)
self.Components.Tracer.Color = color
else
self.Components.Tracer.Visible = false
end
else
self.Components.Tracer.Visible = false
end
end
function ESP:Add(obj, options)
if not obj.Parent and not options.RenderInNil then
return warn(obj, "has no parent")
end
if self:GetBox(obj) then
self:GetBox(obj):Remove()
end
box.Components["Quad"] = Draw("Quad", {
Thickness = self.Thickness,
Color = color,
Transparency = 1,
Filled = false,
Visible = self.Enabled and self.Boxes,
})
box.Components["Name"] = Draw("Text", {
Text = box.Name,
Color = box.Color,
Center = true,
Outline = true,
Size = 19,
Visible = self.Enabled and self.Names,
})
box.Components["Distance"] = Draw("Text", {
Color = box.Color,
Center = true,
Outline = true,
Size = 19,
Visible = self.Enabled and self.Names,
})
box.Components["Tracer"] = Draw("Line", {
Thickness = ESP.Thickness,
Color = box.Color,
Transparency = 1,
Visible = self.Enabled and self.Tracers,
})
self.Objects[obj] = box
obj.AncestryChanged:Connect(function(_, parent)
if parent == nil and ESP.AutoRemove ~= false then
box:Remove()
end
end)
obj:GetPropertyChangedSignal("Parent"):Connect(function()
if obj.Parent == nil and ESP.AutoRemove ~= false then
box:Remove()
end
end)
return box
end
repeat
NextFrame:Wait()
local Delta = tick() - StartTime
local Progress = math.min(Delta / TotalDuration, 1) --Getting the
percentage of completion of the teleport (between 0-1, not 0-100)
--We also use math.min in order to maximize it at 1, in case the player
gets an FPS drop, so it doesn't go past the target.
local MappedPosition = StartingPosition + (PositionDelta * Progress)
HRP.Velocity = Vector3.new() --Resetting the effect of gravity so it
doesn't get too much and drag the player below the ground.
HRP.CFrame = CFrame.new(MappedPosition)
until (HRP.Position - Target).magnitude <= Settings.Farms.TweenSpeed / 2 or
ForceStop
if ForceStop then
ForceStop = false
return
end --
HRP.Anchored = false
HRP.CFrame = CFrame.new(Target) * CFrame.Angles(math.rad(angle), 0, 0)
end
for i, v in pairs(workspace.NPCs:GetDescendants()) do
if v:IsA("Model") and not table.find(npcTable, v.Name) then
table.insert(npcTable, v.Name)
end
end
for i, v in pairs(workspace.NPCs.MissionNPC:GetChildren()) do
if v:IsA("Model") and not table.find(questTable, v.Name) then
table.insert(questTable, v.Name)
end
end
--player.PlayerGui.MissionsUI.Queueing.Visible == false
pairs(game:GetService("ReplicatedStorage").Requests.RequestServerList:InvokeServer(
"Wandenreich City"))
do
if v.JobID ~= game.JobId then
wait()
player.Character.CharacterHandler.Remotes.ServerListTeleport:FireServer("Wandenreic
h City", v.JobID)
break
end
end
elseif game.PlaceId == 14070029709 then
for i, v in
pairs(game:GetService("ReplicatedStorage").Requests.RequestServerList:InvokeServer(
"Soul Society")) do
if v.JobID ~= game.JobId then
wait()
player.Character.CharacterHandler.Remotes.ServerListTeleport:FireServer("Soul
Society", v.JobID)
break
end
end
elseif game.PlaceId == 14069122388 then
for i, v in
pairs(game:GetService("ReplicatedStorage").Requests.RequestServerList:InvokeServer(
"Hueco Mundo")) do
if v.JobID ~= game.JobId then
wait()
player.Character.CharacterHandler.Remotes.ServerListTeleport:FireServer("Hueco
Mundo", v.JobID)
break
end
end
elseif game.PlaceId == 14069678431 then
for i, v in
pairs(game:GetService("ReplicatedStorage").Requests.RequestServerList:InvokeServer(
"Karakura Town")) do
if v.JobID ~= game.JobId then
wait()
player.Character.CharacterHandler.Remotes.ServerListTeleport:FireServer("Karakura
Town", v.JobID)
break
end
end
elseif game.PlaceId == 14069866342 then
for i, v in
pairs(game:GetService("ReplicatedStorage").Requests.RequestServerList:InvokeServer(
"Las Noches")) do
if v.JobID ~= game.JobId then
wait()
player.Character.CharacterHandler.Remotes.ServerListTeleport:FireServer("Las
Noches", v.JobID)
break
end
end
elseif game.PlaceId == 14069956183 then
for i, v in
pairs(game:GetService("ReplicatedStorage").Requests.RequestServerList:InvokeServer(
"Rukon District"))
do
if v.JobID ~= game.JobId then
wait()
player.Character.CharacterHandler.Remotes.ServerListTeleport:FireServer("Rukon
District", v.JobID)
break
end
end
end
end
player.Character.CharacterHandler.Remotes.Weapon:FireServer("UnsheatheWeapon")
else
return
end
end)
end
--//UI
loadstring(game:HttpGet("https://raw.githubusercontent.com/deeeity/mercury-
lib/master/src.lua"))()
local Mercury =
loadstring(game:HttpGet("https://raw.githubusercontent.com/deeeity/mercury-lib/
master/src.lua"))()
local GUI = Mercury:Create({
Name = "Asteria",
Size = UDim2.fromOffset(600, 400),
Theme = Mercury.Themes.Dark,
Link = "Asteria/TypeSoul",
})
local Tab = GUI:Tab({
Name = "Main",
Icon = "rbxassetid://8569322835",
})
Tab:Toggle({
Name = "MobFarm",
StartingState = false,
Description = nil,
Callback = function(state)
Settings.Farms.MobFarm = state
end,
})
Tab:Slider({
Name = "Farm position",
Default = 6,
Min = -25,
Max = 25,
Callback = function(val)
Settings.Farms.Position = val
end,
})
Tab:Slider({
Name = "TweenSpeed",
Default = 80,
Min = 0,
Max = 250,
Callback = function(val)
Settings.Farms.TweenSpeed = val
end,
})
Tab:Toggle({
Name = "Autoequip",
StartingState = false,
Description = nil,
Callback = function(state)
Settings.Farms.Autoequip = state
end,
})
Tab:Toggle({
Name = "Autoquest",
StartingState = false,
Description = nil,
Callback = function(state)
Settings.Autoquest.Toggle = state
end,
})
Tab:Slider({
Name = "Farm position",
Default = 6,
Min = -25,
Max = 25,
Callback = function(val)
Settings.Autoquest.Position = val
end,
})
Tab:Toggle({
Name = "Adju farm",
StartingState = false,
Description = nil,
Callback = function(state)
Settings.Adjfarm.Toggle = state
end,
})
Tab:Slider({
Name = "Farm position",
Default = 6,
Min = -25,
Max = 25,
Callback = function(val)
Settings.Adjfarm.Position = val
end,
})
Tab:Toggle({
Name = "Farm closest",
StartingState = false,
Description = nil,
Callback = function(state)
Settings.Closest.Toggle = state
end,
})
Tab:Slider({
Name = "Farm position",
Default = 6,
Min = -25,
Max = 25,
Callback = function(val)
Settings.Closest.Position = val
end,
})
Tab:Slider({
Name = "Range",
Default = 50,
Min = 0,
Max = 250,
Callback = function(val)
Settings.Closest.range = val
end,
})
Tab:Toggle({
Name = "Minigame simplifier",
StartingState = false,
Description = nil,
Callback = function(state)
Settings.Minigame = state
end,
})
Tab:Toggle({
Name = "Complete res obby",
StartingState = false,
Description = nil,
Callback = function(state)
Settings.Obby = state
end,
})
Tab:Button({
Name = "Serverhop",
Description = nil,
Callback = function()
Teleport()
end,
})
Tab:Button({
Name = "Chatlogger",
Description = nil,
Callback = function()
chatlogger()
end,
})
Tab:Button({
Name = "Streamer mode",
Description = nil,
Callback = function()
streamermode()
end,
})
Tab:Button({
Name = "Instant reset",
Description = nil,
Callback = function()
instantreset()
end,
})
Tab:Button({
Name = "Destroy killbricks",
Description = nil,
Callback = function()
destroykillbricks()
end,
})
Tab:Button({
Name = "Stop tween",
Description = nil,
Callback = function()
stoptween()
end,
})
Tab:Toggle({
Name = "Esp toggle",
StartingState = false,
Description = nil,
Callback = function(state)
ESP.Enabled = state
end,
})
Tab:Toggle({
Name = "Teammates",
StartingState = false,
Description = nil,
Callback = function(state)
ESP.TeamMates = state
end,
})
Tab:Toggle({
Name = "Names",
StartingState = false,
Description = nil,
Callback = function(state)
ESP.Names = state
end,
})
Tab:Toggle({
Name = "Boxes",
StartingState = false,
Description = nil,
Callback = function(state)
ESP.Boxes = state
end,
})
Tab:ColorPicker({
Style = Mercury.ColorPickerStyles.Legacy,
Callback = function(color)
ESP.Color = color
end,
})
--//configs
--//Loops
for i, v in pairs(game.Players:GetChildren()) do
if table.find(modtable, v.UserId) then
player:Kick("An Admin has joined your server")
end
end
end
game:GetService("RunService").Heartbeat:connect(function()
autoquest()
MobFarm()
adjufarm()
autoequip()
farmclosest()
notifier()
obby()
minigame()
end)
game:GetService("RunService").RenderStepped:Connect(function()
cam = workspace.CurrentCamera
for i, v in (ESP.Enabled and pairs or ipairs)(ESP.Objects) do
if v.Update then
local s, e = pcall(v.Update, v)
if not s then
warn("[EU]", e, v.Object:GetFullName())
end
end
end
end)
return ESP