Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dragify(Frame)
- local dragToggle = nil
- local dragSpeed = .25
- local dragInput = nil
- local dragStart = nil
- local startPos = nil
- local function updateInput(input)
- local Delta = input.Position - dragStart
- local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y)
- game:GetService("TweenService"):Create(Frame, TweenInfo.new(dragSpeed), {Position = Position}):Play()
- end
- Frame.InputBegan:Connect(function(input)
- if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
- dragToggle = true
- dragStart = input.Position
- startPos = Frame.Position
- input.Changed:Connect(function()
- if (input.UserInputState == Enum.UserInputState.End) then
- dragToggle = false
- end
- end)
- end
- end)
- Frame.InputChanged:Connect(function(input)
- if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
- dragInput = input
- end
- end)
- game:GetService("UserInputService").InputChanged:Connect(function(input)
- if input == dragInput and dragToggle then
- updateInput(input)
- end
- end)
- end
- function create_gui()
- local UILibrary3 = Instance.new('ScreenGui')
- local section = Instance.new'TextLabel'
- local frame = Instance.new'Frame'
- local UICorner = Instance.new'UICorner'
- local tempbutton = Instance.new'TextButton'
- local UIListLayout = Instance.new'UIListLayout'
- local templabel = Instance.new'TextLabel'
- local tempbox = Instance.new'TextBox'
- local tempdropdown = Instance.new'TextButton'
- local indicator = Instance.new'TextButton'
- local container = Instance.new'Frame'
- local UIListLayout_2 = Instance.new'UIListLayout'
- local UICorner_2 = Instance.new'UICorner'
- local __ = Instance.new'Frame'
- local close = Instance.new'TextButton'
- local minimize = Instance.new'TextButton'
- UILibrary3.Name = 'UI-Library 3'
- UILibrary3.Parent = game:GetService'Players'.LocalPlayer:WaitForChild'PlayerGui'
- UILibrary3.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- section.BackgroundColor3 = Color3.fromRGB(29.000000171363, 29.000000171363, 29.000000171363)
- section.BorderSizePixel = 0
- section.LayoutOrder = 1
- section.Name = 'section'
- section.Parent = UILibrary3
- section.Position = UDim2.new(0.0186824463, 0, 0.0133657409, 0)
- section.Size = UDim2.new(0, 284, 0, 25)
- section.Visible = false
- section.Font = Enum.Font.TitilliumWeb
- section.Text = 'Name'
- section.TextColor3 = Color3.fromRGB(255, 255, 255)
- section.TextScaled = true
- section.TextSize = 14
- section.TextWrapped = true
- frame.BackgroundColor3 = Color3.fromRGB(23.000000528991, 23.000000528991, 23.000000528991)
- frame.BorderSizePixel = 0
- frame.LayoutOrder = 1
- frame.Name = 'frame'
- frame.Parent = section
- frame.Position = UDim2.new(0, 0, 1.04166663, 0)
- frame.Size = UDim2.new(0, 284, 0, 363)
- UICorner.CornerRadius = UDim.new(0, 5)
- UICorner.Parent = frame
- tempbutton.BackgroundColor3 = Color3.fromRGB(15.000000055879, 15.000000055879, 15.000000055879)
- tempbutton.BorderSizePixel = 0
- tempbutton.Name = 'tempbutton'
- tempbutton.Parent = frame
- tempbutton.Position = UDim2.new(0, 0, 0.0165289249, 0)
- tempbutton.Size = UDim2.new(0, 284, 0, 35)
- tempbutton.Visible = false
- tempbutton.Font = Enum.Font.TitilliumWeb
- tempbutton.Text = 'button'
- tempbutton.TextColor3 = Color3.fromRGB(255, 255, 255)
- tempbutton.TextScaled = true
- tempbutton.TextSize = 14
- tempbutton.TextWrapped = true
- UIListLayout.Parent = frame
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- templabel.BackgroundColor3 = Color3.fromRGB(15.000000055879, 15.000000055879, 15.000000055879)
- templabel.BorderSizePixel = 0
- templabel.Name = 'templabel'
- templabel.Parent = frame
- templabel.Position = UDim2.new(0, 0, 0.0964187309, 0)
- templabel.Size = UDim2.new(0, 284, 0, 35)
- templabel.Visible = false
- templabel.Font = Enum.Font.TitilliumWeb
- templabel.Text = 'label'
- templabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- templabel.TextScaled = true
- templabel.TextSize = 14
- templabel.TextWrapped = true
- tempbox.BackgroundColor3 = Color3.fromRGB(15.000000055879, 15.000000055879, 15.000000055879)
- tempbox.BorderSizePixel = 0
- tempbox.Name = 'tempbox'
- tempbox.Parent = frame
- tempbox.Position = UDim2.new(0, 0, 0.192837462, 0)
- tempbox.Size = UDim2.new(0, 284, 0, 35)
- tempbox.Visible = false
- tempbox.Font = Enum.Font.TitilliumWeb
- tempbox.PlaceholderColor3 = Color3.fromRGB(155.00000596046, 155.00000596046, 155.00000596046)
- tempbox.PlaceholderText = 'box'
- tempbox.Text = ''
- tempbox.TextColor3 = Color3.fromRGB(255, 255, 255)
- tempbox.TextScaled = true
- tempbox.TextSize = 14
- tempbox.TextWrapped = true
- tempdropdown.BackgroundColor3 = Color3.fromRGB(15.000000055879, 15.000000055879, 15.000000055879)
- tempdropdown.BorderSizePixel = 0
- tempdropdown.Name = 'tempdropdown'
- tempdropdown.Parent = frame
- tempdropdown.Position = UDim2.new(0, 0, 0.0165289249, 0)
- tempdropdown.Size = UDim2.new(0, 284, 0, 35)
- tempdropdown.Visible = false
- tempdropdown.Font = Enum.Font.TitilliumWeb
- tempdropdown.Text = 'dropdown'
- tempdropdown.TextColor3 = Color3.fromRGB(255, 255, 255)
- tempdropdown.TextScaled = true
- tempdropdown.TextSize = 14
- tempdropdown.TextWrapped = true
- indicator.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- indicator.BackgroundTransparency = 1
- indicator.BorderSizePixel = 0
- indicator.LayoutOrder = 1
- indicator.Name = 'indicator'
- indicator.Parent = tempdropdown
- indicator.Position = UDim2.new(0.911764681, 0, 0, 0)
- indicator.Rotation = 90
- indicator.Size = UDim2.new(0, 25, 0, 31)
- indicator.Font = Enum.Font.Ubuntu
- indicator.Text = '<'
- indicator.TextColor3 = Color3.fromRGB(255, 255, 255)
- indicator.TextSize = 17
- indicator.TextWrapped = true
- container.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- container.BackgroundTransparency = 1
- container.BorderSizePixel = 0
- container.Name = 'container'
- container.Parent = tempdropdown
- container.Position = UDim2.new(0, 0, 1, 0)
- container.Size = UDim2.new(0, 285, 0, 0)
- UIListLayout_2.Parent = container
- UIListLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
- UICorner_2.CornerRadius = UDim.new(0, 5)
- UICorner_2.Parent = section
- __.BackgroundColor3 = Color3.fromRGB(29.000000171363, 29.000000171363, 29.000000171363)
- __.BorderSizePixel = 0
- __.Name = '__'
- __.Parent = section
- __.Position = UDim2.new(0, 0, 0.791666687, 0)
- __.Size = UDim2.new(0, 284, 0, 12)
- close.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- close.BackgroundTransparency = 1
- close.BorderSizePixel = 0
- close.LayoutOrder = 1
- close.Name = 'close'
- close.Parent = section
- close.Position = UDim2.new(0.918806911, 0, 0, 0)
- close.Size = UDim2.new(0, 25, 0, 31)
- close.Font = Enum.Font.Ubuntu
- close.Text = 'X'
- close.TextColor3 = Color3.fromRGB(255, 255, 255)
- close.TextSize = 17
- close.TextWrapped = true
- minimize.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- minimize.BackgroundTransparency = 1
- minimize.BorderSizePixel = 0
- minimize.LayoutOrder = 1
- minimize.Name = 'minimize'
- minimize.Parent = section
- minimize.Position = UDim2.new(0.830778718, 0, 0, 0)
- minimize.Size = UDim2.new(0, 25, 0, 31)
- minimize.Font = Enum.Font.Ubuntu
- minimize.Text = '-'
- minimize.TextColor3 = Color3.fromRGB(255, 255, 255)
- minimize.TextSize = 17
- minimize.TextWrapped = true
- pcall(function()UILibrary3.Parent=game:GetService'CoreGui';--[[syn.protect_gui(UILibrary3)]]end)
- return UILibrary3, section, tempbutton, templabel, tempbox, tempdropdown
- end
- function tween(object, tweentime, info)
- game:GetService'TweenService':Create(object, TweenInfo.new(tweentime, 8), info):Play()
- end
- local main = {}
- function main:CreateGui(name)
- local gui, section, tempbutton, templabel, tempbox, tempdropdown = create_gui()
- local sections = {}
- local firstsection = nil
- local createsections = {}
- gui.Name = name or 'Gui'
- function createsections:CreateSection(name)
- local section = section:Clone()
- local open = true
- local closeEvent = Instance.new'BindableEvent'
- local minimizeEvent = Instance.new'BindableEvent'
- section.Parent = gui
- section.Visible = true
- section.Name = name or 'Section'
- section.Text = name or 'Section'
- dragify(section)
- section.close.MouseButton1Click:connect(function()
- closeEvent:Fire()
- if open then
- for a,object in pairs(section.frame:GetChildren()) do
- pcall(function()
- tween(object, .35, {TextTransparency = 1})
- tween(object, .35, {BackgroundTransparency = 1})
- end)
- end
- tween(section.frame, .45, {Size = UDim2.new(0, 284, 0, 0)})
- tween(section['__'], .55, {BackgroundTransparency = 1})
- tween(section, .65, {TextTransparency = 1})
- tween(section, .65, {BackgroundTransparency = 1})
- tween(section.close, .65, {TextTransparency = 1})
- tween(section.close, .65, {BackgroundTransparency = 1})
- tween(section.minimize, .65, {TextTransparency = 1})
- tween(section.minimize, .65, {BackgroundTransparency = 1})
- wait(.65)
- end
- section:Destroy()
- pcall(function()
- table.remove(sections, table.find(sections, section))
- end)
- end)
- section.minimize.MouseButton1Click:connect(function()
- open = not open
- minimizeEvent:Fire(open)
- if open then
- section.minimize.Text = '-'
- for a,object in pairs(section.frame:GetChildren()) do
- pcall(function()
- tween(object, .35, {TextTransparency = 0})
- tween(object, .35, {BackgroundTransparency = 0})
- end)
- end
- tween(section.frame, .45, {Size = UDim2.new(0, 284, 0, 363)})
- else
- section.minimize.Text = '+'
- for a,object in pairs(section.frame:GetChildren()) do
- pcall(function()
- tween(object, .35, {TextTransparency = 1})
- tween(object, .35, {BackgroundTransparency = 1})
- end)
- end
- tween(section.frame, .45, {Size = UDim2.new(0, 284, 0, 0)})
- end
- end)
- local createobjects = {}
- function createobjects:TextButton(name, func)
- local button = tempbutton:Clone()
- button.Name,button.Text = name or 'button',name or 'button'
- button.Visible = true
- button.Parent = section.frame
- if func then
- button.MouseButton1Click:connect(func)
- end
- return button
- end
- function createobjects:TextLabel(name)
- local label = templabel:Clone()
- label.Name,label.Text = name or 'label',name or 'label'
- label.Visible = true
- label.Parent = section.frame
- return label
- end
- function createobjects:TextBox(name, placeholder, func)
- local box = tempbox:Clone()
- box.Name,box.Text,box.PlaceholderText = name or 'box', '',placeholder or name or 'box'
- box.Visible = true
- box.Parent = section.frame
- if func then
- box:GetPropertyChangedSignal'Text':connect(func)
- end
- return box
- end
- function createobjects:DropDown(name, objects)
- local dropdownOpen = false
- local debounce = false
- local dropdown = tempdropdown:Clone()
- dropdown.Name,dropdown.Text = name or 'dropdown', name or 'dropdown'
- dropdown.Visible = true
- dropdown.Parent = section.frame
- dropdown.container.ChildAdded:connect(function(child)
- if child then
- child.Visible = false
- child.TextTransparency, child.BackgroundTransparency = 1,1
- end
- end)
- if objects then
- for i,object in pairs(objects) do
- if object then
- object.Parent = dropdown.container
- end
- end
- end
- closeEvent.Event:connect(function()
- dropdown.indicator.Rotation = 90
- for i,object in pairs(dropdown.container:GetChildren()) do
- if not object:IsA'UIListLayout' then
- tween(object, .5, {TextTransparency = 1})
- tween(object, .5, {BackgroundTransparency = 1})
- end
- end
- wait(.5)
- for i,object in pairs(dropdown.container:GetChildren()) do
- if not object:IsA'UIListLayout' then
- object.Visible = false
- end
- end
- tween(dropdown.container, .45, {Size = UDim2.new(0, 285, 0, 0)})
- end)
- minimizeEvent.Event:connect(function(toggle)
- if toggle then
- local offset = 0
- for i,object in pairs(dropdown.container:GetChildren()) do
- if not object:IsA'UIListLayout' then
- offset += object.Size.X.Offset
- object.Visible = true
- tween(object, .5, {TextTransparency = 0})
- tween(object, .5, {BackgroundTransparency = 0})
- end
- end
- tween(dropdown.container, .45, {Size = UDim2.new(0, 285, 0, offset)})
- else
- for i,object in pairs(dropdown.container:GetChildren()) do
- if not object:IsA'UIListLayout' then
- tween(object, .5, {TextTransparency = 1})
- tween(object, .5, {BackgroundTransparency = 1})
- end
- end
- wait(.5)
- for i,object in pairs(dropdown.container:GetChildren()) do
- if not object:IsA'UIListLayout' then
- object.Visible = false
- end
- end
- tween(dropdown.container, .45, {Size = UDim2.new(0, 285, 0, 0)})
- end
- end)
- local function toggle()
- if not debounce then
- debounce = true
- dropdownOpen = not dropdownOpen
- if dropdownOpen then
- dropdown.indicator.Rotation = -90
- local offset = 0
- for i,object in pairs(dropdown.container:GetChildren()) do
- if not object:IsA'UIListLayout' then
- offset += object.Size.X.Offset
- object.Visible = true
- tween(object, .5, {TextTransparency = 0})
- tween(object, .5, {BackgroundTransparency = 0})
- end
- end
- tween(dropdown.container, .45, {Size = UDim2.new(0, 285, 0, offset)})
- else
- dropdown.indicator.Rotation = 90
- for i,object in pairs(dropdown.container:GetChildren()) do
- if not object:IsA'UIListLayout' then
- tween(object, .5, {TextTransparency = 1})
- tween(object, .5, {BackgroundTransparency = 1})
- end
- end
- wait(.5)
- for i,object in pairs(dropdown.container:GetChildren()) do
- if not object:IsA'UIListLayout' then
- object.Visible = false
- end
- end
- tween(dropdown.container, .45, {Size = UDim2.new(0, 285, 0, 0)})
- end
- wait(.5)
- debounce = false
- end
- end
- dropdown.MouseButton1Click:connect(toggle)
- dropdown.indicator.MouseButton1Click:connect(toggle)
- end
- table.insert(sections, section)
- if not firstsection then
- firstsection = section
- end
- section.Position = UDim2.new(-.12, #sections * 300, 0, 0)
- return createobjects
- end
- return createsections
- end
- return main
Add Comment
Please, Sign In to add comment