Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local library = {}
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- ScreenGui.ResetOnSpawn = false
- function library:CreateWindow(name)
- wait(0.2)
- local pos = 0.1
- local get = ScreenGui:GetChildren()
- if ScreenGui:FindFirstChild("Container") ~= nil then -- checking if there is already a menu
- for i = 1, #get do
- pos = pos + 0.22
- end
- else
- pos = 0.1
- end
- local Main = Instance.new("Frame")
- local Title = Instance.new("TextLabel")
- local Container = Instance.new("Frame")
- local UIListLayout = Instance.new("UIListLayout")
- local Minimize = Instance.new("TextButton")
- Main.Name = "Main"
- Main.Parent = ScreenGui
- Main.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
- Main.BorderSizePixel = 0
- Main.Position = UDim2.new(0.109173618, 0, 0.0199714694, 0)
- Main.Size = UDim2.new(0, 150, 0, 30)
- Title.Name = "Title"
- Title.Parent = Main
- Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Title.BackgroundTransparency = 1.000
- Title.Size = UDim2.new(1, 0, 0.75, 0)
- Title.Font = Enum.Font.SourceSans
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.TextScaled = true
- Title.TextSize = 14.000
- Title.TextWrapped = true
- Container.Name = "Container"
- Container.Parent = Main
- Container.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
- Container.BorderSizePixel = 0
- Container.ClipsDescendants = true
- Container.Position = UDim2.new(0, 0, 1, 0)
- Container.Size = UDim2.new(0, 150, 0, 135)
- Container.ClipsDescendants = true
- UIListLayout.Parent = Container
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- UIListLayout.Padding = UDim.new(0, 2)
- Minimize.Name = "Minimize"
- Minimize.Parent = Main
- Minimize.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Minimize.BackgroundTransparency = 1.000
- Minimize.Position = UDim2.new(0.800000012, 0, 0, 0)
- Minimize.Size = UDim2.new(0, 30, 0, 30)
- Minimize.Font = Enum.Font.SourceSans
- Minimize.Text = "-"
- Minimize.TextColor3 = Color3.fromRGB(206, 206, 206)
- Minimize.TextScaled = true
- Minimize.TextSize = 14.000
- Minimize.TextWrapped = true
- local old = UDim2.new(0,150,0,0)
- Minimize.MouseButton1Click:Connect(function()
- if Container.Size ~= UDim2.new(0,150,0,0) then
- old = Container.Size
- Container:TweenSize(UDim2.new(0,150,0,0),"In","Sine",0.45,false,nil)
- Minimize.Text = "+"
- else
- Container:TweenSize(old,"Out","Sine",0.45,false,nil)
- Minimize.Text = "-"
- end
- local Window = {}
- function Window:Button(name,callback)
- callback = callback or function() end
- local Button = Instance.new("TextButton")
- Button.Name = "Button"
- Button.Parent = Container
- Button.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
- Button.BorderSizePixel = 0
- Button.Size = UDim2.new(1, 0, 0, 30)
- Button.Font = Enum.Font.SourceSans
- Button.Text = " "..name
- Button.TextColor3 = Color3.fromRGB(206, 206, 206)
- Button.TextSize = 16.000
- Button.TextWrapped = true
- Button.TextXAlignment = Enum.TextXAlignment.Left
- Button.MouseButton1Click:Connect(function()callback()end)
- end
- function Window:Toggle(name,callback)
- local Toggle = Instance.new("TextLabel")
- local TextButton = Instance.new("TextButton")
- Toggle.Name = "Toggle"
- Toggle.Parent = Container
- Toggle.Active = true
- Toggle.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
- Toggle.BorderSizePixel = 0
- Toggle.Selectable = true
- Toggle.Size = UDim2.new(1, 0, 0, 30)
- Toggle.Font = Enum.Font.SourceSans
- Toggle.Text = " "..name
- Toggle.TextColor3 = Color3.fromRGB(206, 206, 206)
- Toggle.TextSize = 16.000
- Toggle.TextWrapped = true
- Toggle.TextXAlignment = Enum.TextXAlignment.Left
- TextButton.Parent = Toggle
- TextButton.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
- TextButton.BorderColor3 = Color3.fromRGB(180, 180, 180)
- TextButton.Position = UDim2.new(0.700000048, 0, 0.0333333351, 0)
- TextButton.Size = UDim2.new(0.266666681, 0, 0, 28)
- TextButton.Font = Enum.Font.SourceSans
- TextButton.Text = ""
- TextButton.TextColor3 = Color3.fromRGB(206, 206, 206)
- TextButton.TextScaled = true
- TextButton.TextSize = 14.000
- TextButton.TextWrapped = true
- TextButton.TextXAlignment = Enum.TextXAlignment.Left
- local tog =0
- TextButton.MouseButton1Click:Connect(function()
- if tog == 0 then
- tog = 1
- callback()
- else
- tog = 0
- end
- end)
- end
- function Window:Box(name,callback)
- local Box = Instance.new("TextLabel")
- local TextButton_2 = Instance.new("TextBox")
- Box.Name = "Box"
- Box.Parent = Container
- Box.Active = true
- Box.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
- Box.BorderSizePixel = 0
- Box.Selectable = true
- Box.Size = UDim2.new(1, 0, 0, 30)
- Box.Font = Enum.Font.SourceSans
- Box.Text = " "..name
- Box.TextColor3 = Color3.fromRGB(206, 206, 206)
- Box.TextSize = 16.000
- Box.TextWrapped = true
- Box.TextXAlignment = Enum.TextXAlignment.Left
- TextButton_2.Name = "TextButton"
- TextButton_2.Parent = Box
- TextButton_2.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
- TextButton_2.BorderColor3 = Color3.fromRGB(180, 180, 180)
- TextButton_2.Position = UDim2.new(0.633333325, 0, 0.0333333351, 0)
- TextButton_2.Size = UDim2.new(0.333333373, 0, 0, 28)
- TextButton_2.Font = Enum.Font.SourceSans
- TextButton_2.Text = ""
- TextButton_2.TextColor3 = Color3.fromRGB(206, 206, 206)
- TextButton_2.TextScaled = true
- TextButton_2.TextSize = 14.000
- TextButton_2.TextWrapped = true
- TextButton_2.TextXAlignment = Enum.TextXAlignment.Left
- TextButton_2.FocusLost:Connect(function()
- callback(TextButton_2.Text)
- end)
- end
- function Window:Slider(name,min,max,estimate,callback)
- min = min or 0
- max = max or 100
- estimate = estimate or true
- local Slider = Instance.new("TextLabel")
- local TextButton_3 = Instance.new("ImageButton")
- local TextButton_4 = Instance.new("ImageButton")
- --Properties:
- Slider.Name = "Slider"
- Slider.Parent = Container
- Slider.Active = true
- Slider.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
- Slider.BorderSizePixel = 0
- Slider.Selectable = true
- Slider.Size = UDim2.new(1, 0, 0, 30)
- Slider.Font = Enum.Font.SourceSans
- Slider.Text = " "..name
- Slider.TextColor3 = Color3.fromRGB(206, 206, 206)
- Slider.TextSize = 16.000
- Slider.TextWrapped = true
- Slider.TextXAlignment = Enum.TextXAlignment.Left
- TextButton_3.Name = "TextButton"
- TextButton_3.Parent = Slider
- TextButton_3.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
- TextButton_3.BackgroundTransparency = 1.000
- TextButton_3.BorderColor3 = Color3.fromRGB(180, 180, 180)
- TextButton_3.BorderSizePixel = 0
- TextButton_3.Position = UDim2.new(0.533333361, 0, 0.0333333351, 0)
- TextButton_3.Size = UDim2.new(0.433333397, 0, 0, 28)
- TextButton_3.Image = "rbxassetid://3570695787"
- TextButton_3.ImageColor3 = Color3.fromRGB(58, 58, 58)
- TextButton_3.ScaleType = Enum.ScaleType.Slice
- TextButton_3.SliceCenter = Rect.new(100, 100, 100, 100)
- TextButton_3.SliceScale = 0.040
- TextButton_4.Name = "TextButton"
- TextButton_4.Parent = TextButton_3
- TextButton_4.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
- TextButton_4.BorderColor3 = Color3.fromRGB(180, 180, 180)
- TextButton_4.BorderSizePixel = 0
- TextButton_4.Size = UDim2.new(0, 0, 1, 0)
- TextButton_4.Image = "rbxassetid://3570695787"
- TextButton_4.ImageTransparency = 0.900
- TextButton_4.ScaleType = Enum.ScaleType.Slice
- TextButton_4.SliceCenter = Rect.new(100, 100, 100, 100)
- TextButton_4.SliceScale = 0.040
- local estimate = true
- local realVal = Slider.Text.." :"
- local Val = Slider
- local Sliderr = TextButton_3
- local mousepressed = false
- print(Sliderr)
- local SliderBtn = TextButton_4
- local Player = game:GetService("Players").LocalPlayer
- local UIS = game:GetService("UserInputService")
- local RuS = game:GetService("RunService")
- -- Properties
- local held = false
- local min = 0
- local max = 100
- local step = 0
- local percentage = 0
- function snap(number, factor)
- if factor == 0 then
- return number
- else
- return math.floor(number/factor+0.5)*factor
- end
- end
- UIS.InputEnded:connect(function(input, processed)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- held = false
- mousepressed = false
- end
- end)
- Sliderr.MouseButton1Down:Connect(function()
- mousepressed = true
- end)
- Sliderr.MouseEnter:connect(function()
- if mousepressed then
- held = true
- end
- end)
- RuS.RenderStepped:connect(function(delta)
- if held then
- local MousePos = UIS:GetMouseLocation().X
- local BtnPos = SliderBtn.Position
- local SliderSize = Slider.AbsoluteSize.X
- local SliderPos = Slider.AbsolutePosition.X
- local pos = snap((MousePos-SliderPos)/SliderSize,step)
- percentage = math.clamp(pos,0,1)
- SliderBtn.Position = UDim2.new(percentage/100,0,BtnPos.Y.Scale, BtnPos.Y.Offset)
- SliderBtn.Size = UDim2.new(percentage,0,1,0)
- local bry = (math.floor((0 + (max - 0) * percentage) * max) / max)
- if estimate == true then
- local big = math.floor(bry)
- Val.Text = realVal..big..""
- elseif estimate == false then
- Val.Text = realVal..bry..""
- end
- end
- end)
- end
- return Window;
- end
- return library;
Advertisement
Add Comment
Please, Sign In to add comment