Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local runService = game:GetService("RunService")
- local ui = {}
- function ui:Init()
- local newui = Instance.new("ScreenGui")
- newui.Name = "NewUI"
- newui.Parent = game.Players.LocalPlayer.PlayerGui
- local optionsLib = {}
- function optionsLib:GetDescendants()
- return newui:GetDescendants()
- end
- function optionsLib:CreatePrimaryWindow()
- local newWindow = Instance.new("Frame")
- newWindow.Name = "PrimaryWindow"
- newWindow.BackgroundColor3 = Color3.fromRGB(61,61,61)
- newWindow.BorderSizePixel = 0
- newWindow.Size = UDim2.new(0,800,0,350)
- newWindow.Position = UDim2.new(0.5,-400,0.5,-175)
- newWindow.Parent = newui
- local inview = false
- local dragging = false
- local lastmousex, lastmousey
- local drag = coroutine.wrap(function()
- while runService.Heartbeat:Wait() do
- if dragging then
- local x, y = mouse.X, mouse.Y
- local dX, dY = x - lastmousex, y - lastmousey
- local dP = UDim2.new(0, dX, 0, dY)
- newWindow.Position = newWindow.Position + dP
- lastmousex, lastmousey = x, y
- end
- end
- end)
- newWindow.MouseEnter:Connect(function()
- inview = true
- end)
- newWindow.MouseLeave:Connect(function()
- if not dragging then
- inview = false
- end
- end)
- mouse.Button1Down:Connect(function()
- if inview then
- dragging = true
- lastmousex, lastmousey = mouse.X, mouse.Y
- end
- end)
- mouse.Button1Up:Connect(function()
- dragging = false
- end)
- drag()
- local visibleToggle = true
- local extraLib = {}
- function extraLib:AddColour(colour, callback)
- local colourContainer = Instance.new("TextButton")
- colourContainer.Name = "ScriptColour"
- colourContainer.BackgroundColor3 = colour
- colourContainer.BorderSizePixel = 0
- colourContainer.MouseButton1Down:Connect(function()
- callback(colour)
- end)
- return colourContainer
- end
- function extraLib:AddOptionTree(options, callback)
- local optionContainer = Instance.new("ScrollingFrame")
- optionContainer.Name = "OptionTree"
- optionContainer.MidImage = "http://www.roblox.com/asset/?id=4812947"
- optionContainer.BottomImage = "http://www.roblox.com/asset/?id=4812947"
- optionContainer.TopImage = "http://www.roblox.com/asset/?id=4812947"
- optionContainer.ScrollBarImageColor3 = Color3.fromRGB(172,172,172)
- optionContainer.ScrollingDirection = Enum.ScrollingDirection.Y
- optionContainer.BackgroundColor3 = Color3.fromRGB(61,61,61)
- optionContainer.BorderSizePixel = 0
- optionContainer.Parent = newWindow
- local optionLayout = Instance.new("UIListLayout")
- optionLayout.Padding = UDim.new(0, 2)
- optionLayout.Parent = optionContainer
- for i,v in pairs(options) do
- local name = v.Name
- local source = v.Source
- local optionButton = Instance.new("TextButton")
- optionButton.Name = "ScriptButton"
- optionButton.Size = UDim2.new(1,-12,0,20)
- optionButton.BackgroundColor3 = Color3.fromRGB(61,61,61)
- optionButton.Text = (" "..name)
- optionButton.TextXAlignment = Enum.TextXAlignment.Left
- optionButton.Font = Enum.Font.SourceSans
- optionButton.TextColor3 = Color3.fromRGB(255,255,255)
- optionButton.TextSize = 14
- optionButton.BorderSizePixel = 0
- optionButton.AutoButtonColor = false
- optionButton.BorderColor3 = Color3.fromRGB(229,78,255)
- optionButton.Parent = optionContainer
- optionButton.MouseEnter:Connect(function()
- for i = 0, 2, 1 do
- optionButton.BorderSizePixel = i
- wait()
- end
- end)
- optionButton.MouseLeave:Connect(function()
- for i = 2, 0, -1 do
- optionButton.BorderSizePixel = i
- wait()
- end
- end)
- optionButton.MouseButton1Down:Connect(function()
- callback(source)
- end)
- end
- return optionContainer
- end
- function extraLib:AddLabel(text)
- local scriptLabel = Instance.new("TextLabel")
- scriptLabel.BackgroundColor3 = Color3.fromRGB(31,31,31)
- scriptLabel.BorderSizePixel = 0
- scriptLabel.Size = UDim2.new(1, 0, 0, 18)
- scriptLabel.Font = Enum.Font.SourceSans
- scriptLabel.Text = text
- scriptLabel.TextSize = 18
- scriptLabel.TextColor3 = Color3.fromRGB(166,166,166)
- scriptLabel.Parent = newWindow
- return scriptLabel
- end
- function extraLib:AddInput(callback)
- local inputBox = Instance.new("TextBox")
- inputBox.BackgroundTransparency = 1
- inputBox.Font = Enum.Font.SourceSans
- inputBox.Text = ""
- inputBox.PlaceholderText = "Write here..."
- inputBox.TextColor3 = Color3.fromRGB(178,178,178)
- inputBox.TextSize = 18
- inputBox.ClearTextOnFocus = false
- inputBox.TextXAlignment = Enum.TextXAlignment.Left
- inputBox.TextYAlignment = Enum.TextYAlignment.Top
- inputBox.MultiLine = true
- inputBox.TextWrapped = true
- inputBox.Parent = newWindow
- inputBox.FocusLost:Connect(function()
- callback(inputBox.Text)
- end)
- return inputBox
- end
- function extraLib:AddButton(title, callback)
- local scriptButton = Instance.new("TextButton")
- scriptButton.Name = "ScriptButton"
- scriptButton.BackgroundColor3 = Color3.fromRGB(76,76,76)
- scriptButton.AutoButtonColor = false
- scriptButton.BorderColor3 = Color3.fromRGB(177,177,177)
- scriptButton.BorderSizePixel = 0
- scriptButton.Font = Enum.Font.SourceSans
- scriptButton.Text = title
- scriptButton.TextColor3 = Color3.fromRGB(255,255,255)
- scriptButton.TextSize = 20
- scriptButton.Parent = newWindow
- scriptButton.MouseEnter:Connect(function()
- scriptButton.BackgroundColor3 = Color3.fromRGB(159, 61, 162)
- scriptButton.BorderSizePixel = 1
- end)
- scriptButton.MouseLeave:Connect(function()
- scriptButton.BackgroundColor3 = Color3.fromRGB(76, 76, 76)
- scriptButton.BorderSizePixel = 0
- end)
- scriptButton.MouseButton1Down:Connect(function()
- callback()
- end)
- return scriptButton
- end
- function extraLib:AddContainer(clips, scrolling)
- local scrolling = scrolling or false
- local newContainer
- if scrolling then
- newContainer = Instance.new("ScrollingFrame")
- newContainer.MidImage = "http://www.roblox.com/asset/?id=4812947"
- newContainer.BottomImage = "http://www.roblox.com/asset/?id=4812947"
- newContainer.TopImage = "http://www.roblox.com/asset/?id=4812947"
- newContainer.ScrollingDirection = Enum.ScrollingDirection.Y
- else
- newContainer = Instance.new("Frame")
- end
- newContainer.Name = "Container"
- newContainer.BackgroundColor3 = Color3.fromRGB(47,47,47)
- newContainer.BorderSizePixel = 0
- newContainer.ClipsDescendants = clips or false
- newContainer.Parent = newWindow
- return newContainer
- end
- function extraLib:ToggleVisibility()
- visibleToggle = not visibleToggle
- newWindow.Visible = visibleToggle
- end
- function extraLib:AddTitle(title, logo)
- local titleContainer = Instance.new("Frame")
- titleContainer.Name = "TitleBar"
- titleContainer.Size = UDim2.new(1,0,0,30)
- titleContainer.Position = UDim2.new(0,0,0,0)
- titleContainer.BackgroundColor3 = Color3.fromRGB(61,61,61)
- titleContainer.BorderSizePixel = 0
- titleContainer.Parent = newWindow
- local titleLabel = Instance.new("TextLabel")
- titleLabel.Name = "Title"
- titleLabel.Size = UDim2.new(1,0,1,0)
- titleLabel.BackgroundTransparency = 1
- titleLabel.Font = Enum.Font.SourceSans
- titleLabel.Text = title
- titleLabel.TextColor3 = Color3.fromRGB(255,255,255)
- titleLabel.TextSize = 18
- titleLabel.Parent = titleContainer
- local logoEnabled = false
- if logo then
- logoEnabled = logo.Enabled or false
- end
- if logoEnabled then
- local text = logo.Text
- local primaryLabel = Instance.new("TextLabel")
- primaryLabel.Name = "LogoEffect1"
- primaryLabel.Size = UDim2.new(0,30,0,30)
- primaryLabel.Position = UDim2.new(0,0,0,0)
- primaryLabel.BackgroundTransparency = 1
- primaryLabel.Text = text:sub(1,1)
- primaryLabel.Font = Enum.Font.SourceSansBold
- primaryLabel.TextSize = 30
- primaryLabel.TextColor3 = Color3.fromRGB(255,255,255)
- primaryLabel.Parent = titleContainer
- local secondaryLabel = Instance.new("TextLabel")
- secondaryLabel.Name = "LogoEffect2"
- secondaryLabel.Size = UDim2.new(0,25,0,25)
- secondaryLabel.Position = UDim2.new(1,-12,0,0)
- secondaryLabel.BackgroundTransparency = 1
- secondaryLabel.Text = text:sub(2)
- secondaryLabel.Font = Enum.Font.SourceSansBold
- secondaryLabel.TextSize = 12
- secondaryLabel.TextYAlignment = Enum.TextYAlignment.Bottom
- secondaryLabel.TextColor3 = Color3.fromRGB(229,78,255)
- secondaryLabel.Parent = primaryLabel
- end
- return titleContainer
- end
- return extraLib
- end
- function optionsLib:CreateSecondaryWindow()
- local newWindow = Instance.new("Frame")
- newWindow.Name = "SecondaryWindow"
- newWindow.BackgroundColor3 = Color3.fromRGB(47,47,47)
- newWindow.BorderSizePixel = 0
- newWindow.Size = UDim2.new(0,500,0,280)
- newWindow.Position = UDim2.new(0.5,-250,0.5,-140)
- newWindow.Parent = newui
- local inview = false
- local dragging = false
- local lastmousex, lastmousey
- local drag2 = coroutine.wrap(function()
- while runService.Heartbeat:Wait() do
- if dragging then
- local x, y = mouse.X, mouse.Y
- local dX, dY = x - lastmousex, y - lastmousey
- local dP = UDim2.new(0, dX, 0, dY)
- newWindow.Position = newWindow.Position + dP
- lastmousex, lastmousey = x, y
- end
- end
- end)
- newWindow.MouseEnter:Connect(function()
- inview = true
- end)
- newWindow.MouseLeave:Connect(function()
- if not dragging then
- inview = false
- end
- end)
- mouse.Button1Down:Connect(function()
- if inview then
- dragging = true
- lastmousex, lastmousey = mouse.X, mouse.Y
- end
- end)
- mouse.Button1Up:Connect(function()
- dragging = false
- end)
- drag2()
- local visibleToggle = true
- local extraLib = {}
- function extraLib:AddOptionTree(options, callback)
- local optionContainer = Instance.new("ScrollingFrame")
- optionContainer.Name = "OptionTree"
- optionContainer.MidImage = "http://www.roblox.com/asset/?id=4812947"
- optionContainer.BottomImage = "http://www.roblox.com/asset/?id=4812947"
- optionContainer.TopImage = "http://www.roblox.com/asset/?id=4812947"
- optionContainer.ScrollBarImageColor3 = Color3.fromRGB(172,172,172)
- optionContainer.ScrollingDirection = Enum.ScrollingDirection.Y
- optionContainer.BackgroundColor3 = Color3.fromRGB(61,61,61)
- optionContainer.BorderSizePixel = 0
- optionContainer.Parent = newWindow
- local optionLayout = Instance.new("UIListLayout")
- optionLayout.Padding = UDim.new(0, 2)
- optionLayout.Parent = optionContainer
- for i,v in pairs(options) do
- local name = v.Name
- local source = v.Source
- local optionButton = Instance.new("TextButton")
- optionButton.Name = "ScriptButton"
- optionButton.Size = UDim2.new(1,-12,0,20)
- optionButton.BackgroundColor3 = Color3.fromRGB(61,61,61)
- optionButton.Text = (" "..name)
- optionButton.TextXAlignment = Enum.TextXAlignment.Left
- optionButton.Font = Enum.Font.SourceSans
- optionButton.TextColor3 = Color3.fromRGB(255,255,255)
- optionButton.TextSize = 14
- optionButton.BorderSizePixel = 0
- optionButton.AutoButtonColor = false
- optionButton.BorderColor3 = Color3.fromRGB(229,78,255)
- optionButton.Parent = optionContainer
- optionButton.MouseEnter:Connect(function()
- for i = 0, 2, 1 do
- optionButton.BorderSizePixel = i
- wait()
- end
- end)
- optionButton.MouseLeave:Connect(function()
- for i = 2, 0, -1 do
- optionButton.BorderSizePixel = i
- wait()
- end
- end)
- optionButton.MouseButton1Down:Connect(function()
- callback(source)
- end)
- end
- return optionContainer
- end
- function extraLib:AddLabel(text)
- local scriptLabel = Instance.new("TextLabel")
- scriptLabel.BackgroundColor3 = Color3.fromRGB(31,31,31)
- scriptLabel.BorderSizePixel = 0
- scriptLabel.Size = UDim2.new(1, 0, 0, 18)
- scriptLabel.Font = Enum.Font.SourceSans
- scriptLabel.Text = text
- scriptLabel.TextSize = 18
- scriptLabel.TextColor3 = Color3.fromRGB(166,166,166)
- scriptLabel.Parent = newWindow
- return scriptLabel
- end
- function extraLib:AddInput(callback)
- local inputBox = Instance.new("TextBox")
- inputBox.BackgroundTransparency = 1
- inputBox.Font = Enum.Font.SourceSans
- inputBox.Text = ""
- inputBox.PlaceholderText = "Write here..."
- inputBox.TextColor3 = Color3.fromRGB(178,178,178)
- inputBox.TextSize = 18
- inputBox.ClearTextOnFocus = false
- inputBox.TextXAlignment = Enum.TextXAlignment.Left
- inputBox.TextYAlignment = Enum.TextYAlignment.Top
- inputBox.MultiLine = true
- inputBox.TextWrapped = true
- inputBox.Parent = newWindow
- inputBox.FocusLost:Connect(function()
- callback(inputBox.Text)
- end)
- return inputBox
- end
- function extraLib:AddButton(title, callback)
- local scriptButton = Instance.new("TextButton")
- scriptButton.Name = "ScriptButton"
- scriptButton.BackgroundColor3 = Color3.fromRGB(76,76,76)
- scriptButton.AutoButtonColor = false
- scriptButton.BorderColor3 = Color3.fromRGB(177,177,177)
- scriptButton.BorderSizePixel = 0
- scriptButton.Font = Enum.Font.SourceSans
- scriptButton.Text = title
- scriptButton.TextColor3 = Color3.fromRGB(255,255,255)
- scriptButton.TextSize = 20
- scriptButton.Parent = newWindow
- scriptButton.MouseEnter:Connect(function()
- scriptButton.BackgroundColor3 = Color3.fromRGB(159, 61, 162)
- scriptButton.BorderSizePixel = 1
- end)
- scriptButton.MouseLeave:Connect(function()
- scriptButton.BackgroundColor3 = Color3.fromRGB(76, 76, 76)
- scriptButton.BorderSizePixel = 0
- end)
- scriptButton.MouseButton1Down:Connect(function()
- callback()
- end)
- return scriptButton
- end
- function extraLib:AddColour(colour, callback)
- local colourContainer = Instance.new("TextButton")
- colourContainer.Text = ""
- colourContainer.Name = "ScriptColour"
- colourContainer.BackgroundColor3 = colour
- colourContainer.AutoButtonColor = false
- colourContainer.BorderSizePixel = 0
- colourContainer.MouseButton1Down:Connect(function()
- callback(colour)
- end)
- return colourContainer
- end
- function extraLib:AddContainer(clips, scrolling)
- local scrolling = scrolling or false
- local newContainer
- if scrolling then
- newContainer = Instance.new("ScrollingFrame")
- newContainer.MidImage = "http://www.roblox.com/asset/?id=4812947"
- newContainer.BottomImage = "http://www.roblox.com/asset/?id=4812947"
- newContainer.TopImage = "http://www.roblox.com/asset/?id=4812947"
- newContainer.ScrollingDirection = Enum.ScrollingDirection.Y
- else
- newContainer = Instance.new("Frame")
- end
- newContainer.Name = "Container"
- newContainer.BackgroundColor3 = Color3.fromRGB(47,47,47)
- newContainer.BorderSizePixel = 0
- newContainer.ClipsDescendants = clips or false
- newContainer.Parent = newWindow
- return newContainer
- end
- function extraLib:ToggleVisibility()
- visibleToggle = not visibleToggle
- newWindow.Visible = visibleToggle
- end
- function extraLib:AddTitle(title, logo)
- local titleContainer = Instance.new("Frame")
- titleContainer.Name = "TitleBar"
- titleContainer.Size = UDim2.new(1,0,0,30)
- titleContainer.Position = UDim2.new(0,0,0,0)
- titleContainer.BackgroundColor3 = Color3.fromRGB(61,61,61)
- titleContainer.BorderSizePixel = 0
- titleContainer.Parent = newWindow
- local titleLabel = Instance.new("TextLabel")
- titleLabel.Name = "Title"
- titleLabel.Size = UDim2.new(1,0,1,0)
- titleLabel.BackgroundTransparency = 1
- titleLabel.Font = Enum.Font.SourceSans
- titleLabel.Text = title
- titleLabel.TextColor3 = Color3.fromRGB(255,255,255)
- titleLabel.TextSize = 18
- titleLabel.Parent = titleContainer
- local logoEnabled = false
- if logo then
- logoEnabled = logo.Enabled or false
- end
- if logoEnabled then
- local text = logo.Text
- local primaryLabel = Instance.new("TextLabel")
- primaryLabel.Name = "LogoEffect1"
- primaryLabel.Size = UDim2.new(0,30,0,30)
- primaryLabel.Position = UDim2.new(0,0,0,0)
- primaryLabel.BackgroundTransparency = 1
- primaryLabel.Text = text:sub(1,1)
- primaryLabel.Font = Enum.Font.SourceSansBold
- primaryLabel.TextSize = 30
- primaryLabel.TextColor3 = Color3.fromRGB(255,255,255)
- primaryLabel.Parent = titleContainer
- local secondaryLabel = Instance.new("TextLabel")
- secondaryLabel.Name = "LogoEffect2"
- secondaryLabel.Size = UDim2.new(0,25,0,25)
- secondaryLabel.Position = UDim2.new(1,-12,0,0)
- secondaryLabel.BackgroundTransparency = 1
- secondaryLabel.Text = text:sub(2)
- secondaryLabel.Font = Enum.Font.SourceSansBold
- secondaryLabel.TextSize = 12
- secondaryLabel.TextYAlignment = Enum.TextYAlignment.Bottom
- secondaryLabel.TextColor3 = Color3.fromRGB(229,78,255)
- secondaryLabel.Parent = primaryLabel
- end
- return titleContainer
- end
- return extraLib
- end
- return optionsLib
- end
- return ui
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement