Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gs = loadstring(game:HttpGet("https://pastebin.com/raw/pKUmK76B"))()
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local inputService = game:GetService("UserInputService")
- local tweenService = game:GetService("TweenService")
- function getXY(guiObject)
- local x, y = mouse.X - guiObject.AbsolutePosition.X, mouse.Y - guiObject.AbsolutePosition.Y
- local xMax, yMax = guiObject.AbsoluteSize.X, guiObject.AbsoluteSize.Y
- x = math.clamp(x, 0, xMax)
- y = math.clamp(y, 0, yMax)
- return x, y, x/xMax, y/yMax
- end
- local library = {}
- function library:Create(clips, name, toggle)
- local clips = clips or true
- local name = name or "xJDiviisionZ UI Lib"
- local toggle = toggle or "Q"
- local keyCode = Enum.KeyCode[toggle]
- local in_view = false
- local dragging = false
- local lastmousex, lastmousey
- local gui
- local container
- local renderbar
- local titlebar
- local options
- local main
- gui = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
- gui.Name = name
- gui.ZIndexBehavior = Enum.ZIndexBehavior.Global
- container = Instance.new("Frame")
- container.Name = "Container"
- container.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- container.BorderSizePixel = 0
- container.Size = UDim2.new(0, 498, 0, 240)
- container.Position = UDim2.new(0.5, -249, 0.5, -120)
- container.Parent = gui
- renderbar = Instance.new("Frame")
- renderbar.Name = "RenderBar"
- renderbar.BackgroundTransparency = 1
- renderbar.Size = UDim2.new(1, 0, 0, 10)
- renderbar.Parent = container
- gs:RenderGradient(renderbar, 6)
- titlebar = Instance.new("Frame")
- titlebar.Name = "TitleBar"
- titlebar.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- titlebar.BorderSizePixel = 0
- titlebar.Size = UDim2.new(1, 0, 0, 30)
- titlebar.Position = UDim2.new(0, 0, 0, 10)
- titlebar.Parent = container
- gs:TextGradient(titlebar, name, 18, Enum.Font.SourceSansBold, Color3.fromRGB(255, 255, 255), Color3.fromRGB(255, 255, 255))
- options = Instance.new("Frame")
- options.Name = "Options"
- options.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- options.BorderSizePixel = 0
- options.Size = UDim2.new(0, 100, 0, 200)
- options.Position = UDim2.new(0, 0, 0, 40)
- options.Parent = container
- main = Instance.new("Frame")
- main.Name = "Main"
- main.BackgroundTransparency = 1
- main.Size = UDim2.new(0, 398, 0, 200)
- main.Position = UDim2.new(0, 100, 0, 40)
- main.Parent = container
- titlebar.MouseEnter:Connect(function()
- in_view = true
- end)
- titlebar.MouseLeave:Connect(function()
- in_view = false
- end)
- mouse.Button1Down:Connect(function()
- if in_view then
- lastmousex = mouse.X
- lastmousey = mouse.Y
- dragging = true
- end
- end)
- mouse.Button1Up:Connect(function()
- dragging = false
- end)
- spawn(function()
- while wait(0.1) do
- if dragging then
- local x, y = mouse.X, mouse.Y
- local deltaX, deltaY = x - lastmousex, y - lastmousey
- container:TweenPosition(container.Position + UDim2.new(0, deltaX, 0, deltaY), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1)
- lastmousex = x
- lastmousey = y
- end
- end
- end)
- local optionsLib = {}
- local n_options = 0
- function optionsLib:AddOption(option)
- local textButton = Instance.new("TextButton")
- textButton.Name = option
- textButton.BackgroundTransparency = 1
- textButton.Size = UDim2.new(1, 0, 0, 30)
- textButton.Text = " " .. tostring(option)
- textButton.Font = Enum.Font.SourceSansBold
- textButton.TextSize = 20
- textButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- textButton.Position = UDim2.new(0, 0, 0, n_options * 30)
- textButton.TextXAlignment = Enum.TextXAlignment.Left
- textButton.Parent = options
- local optionContainer = Instance.new("ScrollingFrame")
- optionContainer.TopImage = "http://www.roblox.com/asset/?id=4812947"
- optionContainer.BottomImage = "http://www.roblox.com/asset/?id=4812947"
- optionContainer.MidImage = "http://www.roblox.com/asset/?id=4812947"
- optionContainer.ScrollBarImageColor3 = Color3.fromRGB(255, 36, 134)
- optionContainer.BorderSizePixel = 0
- optionContainer.ScrollingDirection = Enum.ScrollingDirection.Y
- optionContainer.Name = option
- optionContainer.Size = UDim2.new(1, 0, 1, 0)
- optionContainer.BackgroundTransparency = 1
- optionContainer.Parent = main
- local optionPadding = Instance.new("UIPadding")
- optionPadding.PaddingTop = UDim.new(0, 5)
- optionPadding.PaddingLeft = UDim.new(0, -15)
- optionPadding.Parent = optionContainer
- local optionListLayout = Instance.new("UIListLayout")
- optionListLayout.Padding = UDim.new(0, 5)
- optionListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- optionListLayout.Parent = optionContainer
- optionListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- if n_options == 0 then
- gs:RectGradient(textButton, textButton.AbsoluteSize.X, 30)
- optionContainer.Visible = true
- else
- optionContainer.Visible = false
- end
- n_options = n_options + 1
- textButton.MouseButton1Down:Connect(function()
- for i,v in pairs(options:GetChildren()) do
- gs:ClearGradient(v)
- end
- for i,v in pairs(main:GetChildren()) do
- v.Visible = false
- end
- gs:RectGradient(textButton, textButton.AbsoluteSize.X, 30)
- main[option].Visible = true
- end)
- local guiLib = {}
- function guiLib:AddButton(text, callback)
- local button = Instance.new("TextButton")
- button.Name = text:sub(1, 3):lower().."BTN"
- button.BorderSizePixel = 0
- button.BackgroundColor3 = Color3.fromRGB(17, 17, 17)
- button.Size = UDim2.new(0, 375, 0, 20)
- button.Font = Enum.Font.SourceSansBold
- button.Text = text
- button.TextSize = 20
- button.TextColor3 = Color3.fromRGB(255, 255, 255)
- button.Parent = optionContainer
- gs:RectGradient(button, 375, 20)
- button.MouseButton1Down:Connect(function()
- callback()
- end)
- end
- function guiLib:AddSlider(text, min, max, callback)
- local value = min
- local min = min
- local max = max
- local sliderContainer = Instance.new("Frame")
- sliderContainer.Name = text:sub(1, 3):lower().."SLD"
- sliderContainer.BorderSizePixel = 0
- sliderContainer.BackgroundColor3 = Color3.fromRGB(17, 17, 17)
- sliderContainer.Size = UDim2.new(0, 375, 0, 40)
- sliderContainer.Parent = optionContainer
- local sliderButton = Instance.new("TextButton")
- sliderButton.Name = "SliderButton"
- sliderButton.Text = ""
- sliderButton.AutoButtonColor = false
- sliderButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- sliderButton.BorderSizePixel = 0
- sliderButton.Size = UDim2.new(1, 0, 0, 5)
- sliderButton.Position = UDim2.new(0, 0, 1, -5)
- sliderButton.Parent = sliderContainer
- local sliderText = Instance.new("TextLabel")
- sliderText.BackgroundTransparency = 1
- sliderText.Size = UDim2.new(0, 375, 0, 35)
- sliderText.Text = (text .. ": " .. tostring(value))
- sliderText.Font = Enum.Font.SourceSansBold
- sliderText.TextColor3 = Color3.fromRGB(255, 255, 255)
- sliderText.TextSize = 20
- sliderText.Parent = sliderContainer
- gs:RectGradient(sliderContainer, 375, 40)
- callback(value)
- sliderButton.MouseButton1Down:Connect(function()
- local x, y, scalex, scaley = getXY(sliderButton)
- gs:SliderGradient(sliderButton, {Max = 375, Current = x, Size = 1})
- local newValue = math.floor((min + ((max - min) * scalex)))
- sliderText.Text = (text .. ": " .. tostring(newValue))
- callback(newValue)
- local move = mouse.Move:Connect(function()
- local x, y, scalex, scaley = getXY(sliderButton)
- gs:SliderGradient(sliderButton, {Max = 375, Current = x, Size = 1})
- local newValue = math.floor((min + ((max - min) * scalex)))
- sliderText.Text = (text .. ": " .. tostring(newValue))
- callback(newValue)
- end)
- inputService.InputEnded:Connect(function(check)
- if check.UserInputType == Enum.UserInputType.MouseButton1 then
- move:Disconnect()
- end
- end)
- end)
- end
- function guiLib:AddToggle(text, default, callback)
- local uiToggle = default
- local disColourOne = Color3.fromRGB(184, 0, 31)
- local disColourTwo = Color3.fromRGB(184, 0, 31)
- local enbColourOne = Color3.fromRGB(0, 196, 17)
- local enbColourTwo = Color3.fromRGB(0, 196, 17)
- local toggleContainer = Instance.new("Frame")
- toggleContainer.Name = text:sub(1,3):lower().."TGL"
- toggleContainer.BackgroundTransparency = 1
- toggleContainer.Size = UDim2.new(0, 375, 0, 20)
- toggleContainer.Parent = optionContainer
- local toggleButton = Instance.new("TextButton")
- toggleButton.Text = text
- toggleButton.Font = Enum.Font.SourceSansBold
- toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleButton.BackgroundColor3 = Color3.fromRGB(17, 17, 17)
- toggleButton.BorderSizePixel = 0
- toggleButton.TextSize = 20
- toggleButton.Size = UDim2.new(0, 351, 1, 0)
- toggleButton.Parent = toggleContainer
- local toggleFrame = Instance.new("Frame")
- toggleFrame.BackgroundColor3 = Color3.fromRGB(17, 17, 17)
- toggleFrame.BorderSizePixel = 0
- toggleFrame.Size = UDim2.new(0, 20, 0, 20)
- toggleFrame.Position = UDim2.new(1, -20, 0, 0)
- toggleFrame.Parent = toggleContainer
- gs:RectGradient(toggleButton, 351, 20)
- local function update()
- if uiToggle then
- gs:RectGradient(toggleFrame, 20, 20, enbColourOne, enbColourTwo)
- else
- gs:RectGradient(toggleFrame, 20, 20, disColourOne, disColourTwo)
- end
- end
- update()
- callback(uiToggle)
- toggleButton.MouseButton1Down:Connect(function()
- uiToggle = not uiToggle
- update()
- callback(uiToggle)
- end)
- end
- function guiLib:AddDropdown(text, optionTable, callback)
- local nOptions = #optionTable
- local open = false
- local dropContainer = Instance.new("Frame")
- dropContainer.BackgroundColor3 = Color3.fromRGB(17, 17, 17)
- dropContainer.BorderSizePixel = 0
- dropContainer.Size = UDim2.new(0, 375, 0, 20)
- dropContainer.Parent = optionContainer
- local tableContainer = Instance.new("Frame")
- tableContainer.BackgroundColor3 = Color3.fromRGB(24, 24, 24)
- tableContainer.BorderSizePixel = 0
- tableContainer.Position = UDim2.new(0, 0, 0, 20)
- tableContainer.Size = UDim2.new(0, 375, 0, 0)
- tableContainer.ClipsDescendants = true
- tableContainer.Parent = dropContainer
- local tableLayout = Instance.new("UIListLayout")
- tableLayout.SortOrder = Enum.SortOrder.LayoutOrder
- tableLayout.Parent = tableContainer
- local dropStatus = Instance.new("ImageButton")
- dropStatus.BackgroundTransparency = 1
- dropStatus.Size = UDim2.new(0, 20, 0, 20)
- dropStatus.Image = "http://www.roblox.com/asset/?id=71659683"
- dropStatus.Parent = dropContainer
- local dropText = Instance.new("TextLabel")
- dropText.BackgroundTransparency = 1
- dropText.Size = UDim2.new(1, 0, 0, 20)
- dropText.Font = Enum.Font.SourceSansBold
- dropText.Text = text
- dropText.TextColor3 = Color3.fromRGB(255, 255, 255)
- dropText.TextSize = 20
- dropText.Parent = dropContainer
- for i,v in pairs(optionTable) do
- local dropButton = Instance.new("TextButton")
- dropButton.BackgroundColor3 = Color3.fromRGB(24, 24, 24)
- dropButton.BorderSizePixel = 0
- dropButton.Size = UDim2.new(0, 375, 0, 20)
- dropButton.Font = Enum.Font.SourceSansBold
- dropButton.Text = v
- dropButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- dropButton.TextSize = 20
- dropButton.ZIndex = 2
- dropButton.Parent = tableContainer
- gs:RectGradient(dropButton, 375, 20)
- dropButton.MouseButton1Down:Connect(function()
- callback(v)
- end)
- end
- gs:RectGradient(dropContainer, 375, 20)
- dropStatus.MouseButton1Down:Connect(function()
- open = not open
- if open then
- tweenService:Create(dropStatus, TweenInfo.new(0.5), {Rotation = 90}):Play()
- tableContainer:TweenSize(UDim2.new(0, 375, 0, nOptions * 20), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.5, true)
- dropContainer:TweenSize(UDim2.new(0, 375, 0, (nOptions + 1) * 20), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.5, true)
- else
- tweenService:Create(dropStatus, TweenInfo.new(0.5), {Rotation = 0}):Play()
- tableContainer:TweenSize(UDim2.new(0, 375, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.5, true)
- dropContainer:TweenSize(UDim2.new(0, 375, 0, 20), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.5, true)
- end
- end)
- end
- function guiLib:AddInput(text, callback)
- local inputFrame = Instance.new("Frame")
- inputFrame.BackgroundColor3 = Color3.fromRGB(17, 17, 17)
- inputFrame.Size = UDim2.new(0, 375, 0, 20)
- inputFrame.BorderSizePixel = 0
- inputFrame.Parent = optionContainer
- gs:RectGradient(inputFrame, 375, 20)
- local inputLabel = Instance.new("TextLabel")
- inputLabel.BackgroundTransparency = 1
- inputLabel.Size = UDim2.new(0, 192, 0, 20)
- inputLabel.Font = Enum.Font.SourceSansBold
- inputLabel.Text = text
- inputLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- inputLabel.TextSize = 20
- inputLabel.Parent = inputFrame
- local inputBox = Instance.new("TextBox")
- inputBox.Position = UDim2.new(0.5, 0, 0, 0)
- inputBox.Size = UDim2.new(0.5, 0, 1, 0)
- inputBox.Font = Enum.Font.SourceSansBold
- inputBox.Text = ""
- inputBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- inputBox.BackgroundColor3 = Color3.fromRGB(24, 24, 24)
- inputBox.BorderSizePixel = 0
- inputBox.TextSize = 18
- inputBox.Parent = inputFrame
- inputBox.FocusLost:Connect(function()
- callback(inputBox.Text)
- end)
- end
- return guiLib
- end
- return optionsLib
- end
- return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement