Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Documentation:
- -> CreateWindow(<string> Text)
- -> Window:AddToggle(<string> Text, <function> CallBack)
- -> Window:AddLabel(<string> Text)
- -> Window:AddButton(<string> Text, <function> CallBack)
- -> Window:AddBox(<string> Text, <function> CallBack)
- -> Window:AddSlider(<string> Text, <int> Min, <int> Max,<int> Position, <function> CallBack)
- -> Window:AddKeyBind(<string> Text, <int> Keycode, <function> CallBack)
- -> Window:AddDropDown(<string> DropDownName, <string> SelectedObject, <table> Objects, <function> CallBack)
- ]]
- local ShowerLib = {WindowCount = 0;GUIs = {};Defaults = {TextColor = Color3.fromRGB(255, 255, 255);Highlight = Color3.fromRGB(0, 255, 140);GUITopColor = Color3.fromRGB(50, 50, 50);GUIBgColor = Color3.fromRGB(40, 40, 40);}}
- function ShowerLib:Create(InstanceClass, Properties)
- assert(InstanceClass, "Instance class must be specified")
- assert(Properties, "Properties must be specified")
- local Inst = Instance.new(InstanceClass)
- for k, v in pairs(Properties) do
- if k ~= "Parent" then Inst[k] = v end
- end
- Inst.Parent = Properties.Parent
- return Inst
- end
- function ShowerLib:CreateWindow(Name)
- self.WindowCount = self.WindowCount + 1;
- assert(Name, "stupid nigga")
- local GUI = {Enabled = false;Items = 0; Toggles = {}; Objects = {Toggles = {};Buttons = {};};}
- self.WindowCore = self.WindowCore or self:Create("ScreenGui", {
- Name = "nigga";
- Parent = game:GetService("CoreGui")
- });
- GUI.Main = self:Create("ImageLabel", {
- Name = "nigga";
- Active = true;
- Draggable = true;
- Parent = self.WindowCore;
- BackgroundColor3 = Color3.fromRGB(31, 31, 31);
- Position = UDim2.new(0, (15 + ((215 * self.WindowCount) - 200)), 0, 15);
- Size = UDim2.new(0, 200, 0, 25);
- ScaleType = Enum.ScaleType.Slice;
- SliceScale = 0.04;
- SliceCenter = Rect.new(100, 100, 100, 100);
- ImageColor3 = Color3.fromRGB(31, 31, 31);
- BorderSizePixel = 0;
- });
- self:Create("Frame", {
- Name = "nigga";
- Parent = GUI.Main;
- Size = UDim2.new(1, 0, 0, 8);
- Position = UDim2.new(0, 0, 1, -8);
- BackgroundColor3 = Color3.fromRGB(31, 31, 31);
- BorderSizePixel = 0;
- })
- GUI.Background = self:Create("Frame", {
- Name = 'Container'..self.WindowCount;
- Parent = GUI.Main,
- BorderSizePixel = 0;
- BackgroundColor3 = Color3.fromRGB(23, 23, 23);
- Position = UDim2.new(0, 0, 1, 0),
- Size = UDim2.new(1, 0, 0, 25),
- ClipsDescendants = true;
- });
- self:Create("Frame", {
- Name = "nigga";
- Parent = GUI.Background;
- Size = UDim2.new(1, 0, 0, 8);
- BackgroundColor3 = Color3.fromRGB(23, 23, 23);
- BorderSizePixel = 0;
- });
- GUI.Container = self:Create("Frame", {
- Name ="nigga";
- Parent = GUI.Background;
- Size = UDim2.new(1, 0, 1, 0);
- BackgroundTransparency = 1;
- ClipsDescendants = true;
- });
- GUI.Sorter = self:Create("UIListLayout", {
- Name = "nigga";
- Parent = GUI.Container;
- Padding = UDim.new(0, 5);
- SortOrder = Enum.SortOrder.LayoutOrder;
- });
- GUI.Padding = self:Create("UIPadding", {
- Name = "nigga";
- Parent = GUI.Container;
- PaddingLeft = UDim.new(0, 10);
- PaddingTop = UDim.new(0, 5);
- });
- local State = self:Create("TextButton", {
- Name = "nigga";
- Parent = GUI.Main;
- AnchorPoint = Vector2.new(0, 0.5);
- BackgroundTransparency = 1;
- BorderSizePixel = 0;
- Position = UDim2.new(1, -30, 0.5, 0);
- Size = UDim2.new(0, 30, 0, 30);
- TextColor3 = Color3.new(255,255,255);
- Text = "+";
- Font = Enum.Font.GothamSemibold;
- TextSize = 17;
- });
- State.MouseButton1Click:Connect(function()
- GUI.Enabled = not GUI.Enabled
- if GUI.Enabled then
- GUI:Resize(true, UDim2.new(1, 0, 0, 0))
- game:GetService("TweenService"):Create(State, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Rotation = -150}):Play()
- wait(0.2)
- game:GetService("TweenService"):Create(State, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Rotation = 0}):Play()
- State.Text = "x"
- else
- GUI:Resize(true)
- game:GetService("TweenService"):Create(State, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Rotation = -150}):Play()
- wait(0.2)
- game:GetService("TweenService"):Create(State, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Rotation = 0}):Play()
- State.Text = "+"
- end
- end)
- self:Create("TextLabel", {
- Name = "nigga";
- Parent = GUI.Main;
- BackgroundTransparency = 1;
- Size = UDim2.new(1, 0, 1, 0);
- Font = Enum.Font.GothamSemibold;
- TextColor3 = Color3.new(1, 1, 1);
- TextSize = 14;
- TextXAlignment = Enum.TextXAlignment.Left;
- Text =" "..Name;
- });
- local function GetSize()
- local YSize = 0
- local ObjCount = 0
- for k, v in pairs(GUI.Container:GetChildren()) do
- if (not v:IsA("UIListLayout")) and (not v:IsA("UIPadding")) then
- YSize = YSize + v.AbsoluteSize.Y
- ObjCount = ObjCount + 1
- end
- end
- YSize = YSize + (5 * ObjCount)
- return UDim2.new(1, 0, 0, YSize + 10)
- end
- function GUI:Resize(Tween, Change)
- local Size = Change or GetSize()
- self.Background.ClipsDescendants = true;
- if Tween then
- self.Background:TweenSize(Size, Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.2, true)
- else
- self.Background.Size = Size
- end
- end
- function GUI:AddToggle(Text, Callback)
- assert(Text,"stupid nigger")
- self.Items = self.Items + 1
- Callback = Callback or function() end
- local Label = ShowerLib:Create("TextLabel", {
- Name = Text;
- Parent = self.Container;
- BackgroundTransparency = 1;
- Size = UDim2.new(1, -10, 0, 25);
- Font = Enum.Font.Gotham;
- TextSize = 13;
- TextColor3 = Color3.fromRGB(179,179,179);
- TextXAlignment = Enum.TextXAlignment.Left;
- Text = Text;
- LayoutOrder = self.Items;
- });
- local ToggleButton = ShowerLib:Create("TextButton", {
- Name = "nigga";
- Parent = Label;
- Size = UDim2.new(0, 20, 0.8, 0);
- BorderSizePixel = 0;
- Position = UDim2.new(1, -17, 0.1, 0);
- BackgroundColor3 = Color3.fromRGB(255, 67, 92);
- Font = Enum.Font.SourceSans;
- Text = "";
- TextColor3 = Color3.fromRGB(0, 0, 0);
- TextSize = 14.000;
- ClipsDescendants = true;
- LayoutOrder = self.Items;
- });
- ToggleButton.MouseButton1Click:Connect(function()
- self.Toggles[Text] = (not self.Toggles[Text])
- spawn(function()
- if self.Toggles[Text] then
- game:GetService("TweenService"):Create(ToggleButton, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {BackgroundColor3 = (Color3.fromRGB(0, 255, 127))}):Play()
- else
- game:GetService("TweenService"):Create(ToggleButton, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {BackgroundColor3 = (Color3.fromRGB(255, 67, 92))}):Play()
- end
- end)
- Callback(self.Toggles[Text])
- end)
- self:Resize()
- table.insert(self.Objects.Toggles, ToggleButton)
- return ToggleButton
- end
- function GUI:AddBox(Text, Callback)
- assert(Text, "stupid nigger")
- self.Items = self.Items + 1
- Callback = Callback or function() end
- local Box = ShowerLib:Create("TextBox", {
- Name = "Box";
- Parent = self.Container;
- BorderSizePixel = 0;
- Size = UDim2.new(1, -5, 0, 27);
- Font = Enum.Font.GothamSemibold;
- TextSize = 13;
- TextWrapped = true;
- BackgroundColor3 = Color3.fromRGB(40, 40, 40);
- TextColor3 = Color3.fromRGB(255, 255, 255);
- PlaceholderColor3 = Color3.fromRGB(179,179,179);
- PlaceholderText = Text;
- Text = "";
- LayoutOrder = self.Items;
- })
- Box.FocusLost:Connect(function(EnterPressed)
- if not EnterPressed then return end
- Callback(Box.Text)
- Box.Text = ""
- end)
- self:Resize()
- return Box
- end
- function GUI:AddButton(Text, Callback)
- assert(Text, "stupid nigger")
- self.Items = self.Items + 1
- Callback = Callback or function() end
- local Button = ShowerLib:Create("TextButton", {
- Name = Text;
- Parent = self.Container;
- Size = UDim2.new(1, -7, 0, 20);
- Font = Enum.Font.Gotham;
- TextSize = 14;
- BackgroundColor3 = Color3.fromRGB(27, 27, 27);
- BorderSizePixel = 0;
- TextColor3 = Color3.fromRGB(179,179,179);
- TextXAlignment = Enum.TextXAlignment.Center;
- Text = Text;
- LayoutOrder = self.Items;
- });
- Button.MouseButton1Click:Connect(Callback)
- self:Resize()
- table.insert(self.Objects.Buttons, Img)
- return Button
- end
- function GUI:AddSlider(Text, min, max, startPoint, callback)
- assert(Text, "stupid nigger")
- assert(min, "stupid nigger")
- assert(max, "stupid nigger")
- assert(startPoint, "stupid nigger")
- assert(callback, "stupid nigger")
- self.Items = self.Items + 1
- local dragging = false;
- local label = ShowerLib:Create("TextLabel", {
- Name = Text;
- Parent = self.Container;
- BackgroundTransparency = 1;
- Size = UDim2.new(1, -10, 0, 25);
- Font = Enum.Font.Gotham;
- TextSize = 13;
- TextColor3 = Color3.fromRGB(179,179,179);
- TextXAlignment = Enum.TextXAlignment.Left;
- Text = Text;
- LayoutOrder = self.Items;
- });
- local sliderFrame = ShowerLib:Create("ImageLabel", {
- Parent = label;
- BackgroundTransparency = 1;
- Position = UDim2.new(1, -65, 0.5, -3);
- Size = UDim2.new(0, 70, 0, 6);
- Image = "rbxassetid://3570695787";
- ImageColor3 = Color3.fromRGB(75, 75, 75);
- ScaleType = "Slice";
- SliceCenter = Rect.new(100, 100, 100, 100);
- });
- local slidingFrame = ShowerLib:Create("ImageLabel", {
- Parent = sliderFrame;
- BackgroundTransparency = 1;
- Position = UDim2.new((startPoint or 0)/max, -6, 0.5, -5);
- Size = UDim2.new(0, 10, 0, 10);
- Image = "rbxassetid://3570695787";
- ScaleType = "Slice";
- SliceCenter = Rect.new(100, 100, 100, 100);
- ImageColor3 = Color3.fromRGB(255, 255, 255);
- });
- local val = Instance.new("TextLabel", sliderFrame)
- val.BackgroundTransparency = 1
- val.Position = UDim2.new(0, 0, 1, 1)
- val.Size = UDim2.new(1, 0, 0, 10)
- val.Font = "GothamSemibold"
- val.TextColor3 = Color3.new(1, 1, 1)
- val.TextScaled = true
- val.TextTransparency = 1
- val.Text = tostring(startPoint and math.floor((startPoint / max) * (max - min) + min) or 0).."/"..tostring(max)
- self:Resize()
- local function move(input)
- local pos = UDim2.new(math.clamp((input.Position.X - sliderFrame.AbsolutePosition.X) / sliderFrame.AbsoluteSize.X, 0, 1), -6, 0.5, -5)
- slidingFrame:TweenPosition(pos, "Out", "Sine", 0.1, true);
- local value = math.floor(((pos.X.Scale * max) / max) * (max - min) + min)
- val.Text = tostring(value).."/"..tostring(max);
- callback(value)
- end
- slidingFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true;
- local b = game:GetService("TweenService"):Create(val, TweenInfo.new(0.2), {TextTransparency = 0})
- b:Play()
- end
- end)
- slidingFrame.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false;
- wait(1)
- local b = game:GetService("TweenService"):Create(val, TweenInfo.new(0.2), {TextTransparency = 1})
- b:Play()
- end
- end)
- game:GetService("UserInputService").InputChanged:Connect(function(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- move(input)
- end
- end)
- return label
- -----------------------
- end
- function GUI:AddLabel(Text)
- assert(Text, "stupid nigger")
- self.Items = self.Items + 1
- local Label = ShowerLib:Create("TextLabel", {
- Parent = self.Container;
- Name = Text;
- BackgroundTransparency = 1;
- BorderSizePixel = 0;
- TextXAlignment = Enum.TextXAlignment.Left;
- Size = UDim2.new(1, -10, 0, 15);
- LayoutOrder = self.Items;
- Font = Enum.Font.Gotham;
- TextSize = 12;
- Text = Text;
- TextColor3 = Color3.fromRGB(179,179,179);
- })
- self:Resize()
- return Label
- end
- function GUI:AddKeyBind(Text, Default, Callback)
- assert(Text,"stupid nigger tx")
- assert(Default,"stupid nigger Default")
- assert(Callback,"stupid nigger Callback")
- local Identify
- repeat
- wait()
- Identify = math.random(0,999999999)
- until shared["KeyBindName"..tostring(Identify)] == nil
- self.Items = self.Items + 1
- Callback = Callback or function() end
- local Label = ShowerLib:Create("TextLabel", {
- Name = Text;
- Parent = self.Container;
- BackgroundTransparency = 1;
- Size = UDim2.new(1, -10, 0, 25);
- Font = Enum.Font.Gotham;
- TextSize = 13;
- TextColor3 = Color3.fromRGB(179,179,179);
- TextXAlignment = Enum.TextXAlignment.Left;
- Text = Text;
- LayoutOrder = self.Items;
- });
- local TextButton = ShowerLib:Create("TextButton", {
- Name = "nigga";
- Parent = Label;
- Size = UDim2.new(0, 35, 0.8, 0);
- BorderSizePixel = 0;
- Position = UDim2.new(1, -32, 0.1, 0);
- BackgroundColor3 = Color3.fromRGB(27,27,27);
- Font = Enum.Font.SourceSans;
- Text = Default.Name;
- TextColor3 = Color3.fromRGB(179,179,179);
- TextSize = 12;
- ClipsDescendants = true;
- LayoutOrder = self.Items;
- });
- shared["KeyBindName"..tostring(Identify)] = Default.Name
- TextButton.MouseButton1Click:connect(function(e)
- TextButton.Text = "..."
- local a, b = game:GetService('UserInputService').InputBegan:wait();
- if a.KeyCode.Name ~= "Unknown" then
- TextButton.Text = a.KeyCode.Name
- shared["KeyBindName"..tostring(Identify)] = a.KeyCode.Name
- end
- end)
- game:GetService("UserInputService").InputBegan:connect(function(Nigger1, Nigger)
- if not Nigger then
- if Nigger1.KeyCode.Name == shared["KeyBindName"..tostring(Identify)] then
- Callback()
- end
- end
- end)
- self:Resize()
- return TextButton
- end
- function GUI:AddDropDown(DropdownName, Default, Objects, Callback)
- assert(DropdownName, "stupid nigger")
- assert(Objects, "stupid nigger")
- local WindowCount = tostring(self.Container.Parent)
- local CurrentWindow = WindowCount:gsub("Container", "")
- WindowCount = WindowCount:gsub("Container", "")
- local Main = ShowerLib:Create("ImageLabel", {
- Visible = false;
- Name = "nigga";
- Active = true;
- Parent = self.Container.Parent.Parent.Parent;
- BackgroundColor3 = Color3.fromRGB(31, 31, 31);
- Position = UDim2.new(0, (15 + ((215 * WindowCount) - 200)), 0, self.Container.Parent.Parent.Position.Y.Offset + ( 55 + self.Container.Parent.Size.Y.Offset));
- Size = UDim2.new(0, 200, 0, 25);
- ScaleType = Enum.ScaleType.Slice;
- SliceScale = 0.04;
- SliceCenter = Rect.new(100, 100, 100, 100);
- ImageColor3 = Color3.fromRGB(31, 31, 31);
- BorderSizePixel = 0;
- });
- ShowerLib:Create("Frame", {
- Name = "nigga";
- Parent = Main;
- Size = UDim2.new(1, 0, 0, 8);
- Position = UDim2.new(0, 0, 1, -8);
- BackgroundColor3 = Color3.fromRGB(31, 31, 31);
- BorderSizePixel = 0;
- })
- local Background = ShowerLib:Create("Frame", {
- Name = 'Container';
- Parent = Main,
- BorderSizePixel = 0;
- BackgroundColor3 = Color3.fromRGB(23, 23, 23);
- Position = UDim2.new(0, 0, 1, 0),
- Size = UDim2.new(1, 0, 0, 25),
- ClipsDescendants = true;
- });
- ShowerLib:Create("Frame", {
- Name = "nigga";
- Parent = Background;
- Size = UDim2.new(1, 0, 0, 8);
- BackgroundColor3 = Color3.fromRGB(23, 23, 23);
- BorderSizePixel = 0;
- });
- local Container = ShowerLib:Create("Frame", {
- Name ="nigga";
- Parent = Background;
- Size = UDim2.new(1, 0, 1, 0);
- BackgroundTransparency = 1;
- ClipsDescendants = true;
- });
- local Sorter = ShowerLib:Create("UIListLayout", {
- Name = "nigga";
- Parent = Container;
- Padding = UDim.new(0, 5);
- SortOrder = Enum.SortOrder.LayoutOrder;
- });
- local Padding = ShowerLib:Create("UIPadding", {
- Name = "nigga";
- Parent = Container;
- PaddingLeft = UDim.new(0, 10);
- PaddingTop = UDim.new(0, 5);
- });
- ShowerLib:Create("TextLabel", {
- Name = "nigga";
- Parent = Main;
- BackgroundTransparency = 1;
- Size = UDim2.new(1, 0, 1, 0);
- Font = Enum.Font.GothamSemibold;
- TextColor3 = Color3.new(1, 1, 1);
- TextSize = 14;
- TextXAlignment = Enum.TextXAlignment.Left;
- Text =" "..DropdownName;
- });
- local Button
- local function GetPerfectSize()
- local YSize = 0
- local ObjCount = 0
- for k, v in pairs(Container:GetChildren()) do
- if (not v:IsA("UIListLayout")) and (not v:IsA("UIPadding")) then
- YSize = YSize + v.AbsoluteSize.Y
- ObjCount = ObjCount + 1
- end
- end
- YSize = YSize + (5 * ObjCount)
- return UDim2.new(1, 0, 0, YSize + 10)
- end
- for i,v in pairs(Objects) do
- local DropDownButton = ShowerLib:Create("TextButton", {
- Name = Text;
- Parent = Container;
- Size = UDim2.new(1, -7, 0, 15);
- Font = Enum.Font.Gotham;
- TextSize = 12;
- BackgroundColor3 = Color3.fromRGB(27, 27, 27);
- BorderSizePixel = 0;
- TextColor3 = Color3.fromRGB(179,179,179);
- TextXAlignment = Enum.TextXAlignment.Center;
- Text = tostring(v);
- LayoutOrder = self.Items;
- });
- DropDownButton.MouseButton1Click:Connect(function()
- Button.Text = " "..tostring(v)
- Main:TweenPosition(UDim2.new(0, (15 + ((215 * WindowCount) - 200)), 0, self.Container.Parent.Parent.Position.Y.Offset + ( 55 + self.Container.Parent.Size.Y.Offset)), "Out", "Sine", 0.1, true);
- Main.Visible = false
- Callback(v)
- end)
- Background.Size = GetPerfectSize()
- end
- local Container = ShowerLib:Create("Frame", {
- Name = DropdownName;
- Parent = self.Container;
- Size = UDim2.new(1, -7, 0, 20);
- BackgroundColor3 = Color3.fromRGB(27, 27, 27);
- BorderSizePixel = 0;
- LayoutOrder = self.Items;
- });
- ShowerLib:Create("TextButton", {
- Name = DropdownName;
- Parent = Container;
- Size = UDim2.new(1, -7, 0, 20);
- Font = Enum.Font.Gotham;
- TextSize = 14;
- BackgroundColor3 = Color3.fromRGB(27, 27, 27);
- BorderSizePixel = 0;
- TextColor3 = Color3.fromRGB(179,179,179);
- TextXAlignment = Enum.TextXAlignment.Right;
- Text = ">";
- AutoButtonColor = false;
- });
- Button = ShowerLib:Create("TextButton", {
- Name = DropdownName;
- Parent = Container;
- Font = Enum.Font.Gotham;
- TextSize = 14;
- Size = UDim2.new(1, -30, 0, 20);
- BackgroundColor3 = Color3.fromRGB(27, 27, 27);
- BorderSizePixel = 0;
- TextColor3 = Color3.fromRGB(179,179,179);
- TextXAlignment = Enum.TextXAlignment.Left;
- Text = " "..Default;
- AutoButtonColor = false;
- });
- local pos = Main.Position
- Button.MouseButton1Click:Connect(function()
- if Main.Visible then
- Main:TweenPosition(UDim2.new(0, (15 + ((215 * WindowCount) - 200)), 0, self.Container.Parent.Parent.Position.Y.Offset + ( 55 + self.Container.Parent.Size.Y.Offset)), "Out", "Sine", 0.1, true);
- Main.Visible = false
- else
- Main:TweenPosition(pos, "Out", "Sine", 0.1, true);
- Main.Visible = true
- end
- end)
- self:Resize()
- return Main
- end
- return GUI
- end
- return ShowerLib
Add Comment
Please, Sign In to add comment