Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sectionlibrary = {}
- function sectionlibrary:CreateSection(sectionName)
- local uilibrary = Instance.new("ScreenGui")
- local sections = Instance.new("Frame")
- local template = Instance.new("ImageLabel")
- local top = Instance.new("ImageLabel")
- local shadow = Instance.new("Frame")
- local shadowgradiant = Instance.new("UIGradient")
- local title = Instance.new("TextLabel")
- local grad = Instance.new("UIGradient")
- local main = Instance.new("Frame")
- local buttonTemplate = Instance.new("TextButton")
- local UIListLayout = Instance.new("UIListLayout")
- local labelTemplate = Instance.new("TextLabel")
- local boxTemplate = Instance.new("TextBox")
- local dropdownTemplate = Instance.new("TextButton")
- local openClose = Instance.new("TextButton")
- local dropdown = Instance.new("Frame")
- uilibrary.Name = "~~<[{(uilibrary)}]>~~"
- uilibrary.Parent = game:GetService'CoreGui'
- pcall(function() syn.protect_gui(uilibrary) end)
- uilibrary.ResetOnSpawn = false
- sections.Name = "sections"
- sections.Parent = uilibrary
- sections.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- sections.BackgroundTransparency = 1.000
- sections.BorderSizePixel = 0
- sections.Position = UDim2.new(0.0127272531, 0, 0.0109223304, 0)
- sections.Size = UDim2.new(0, 1086, 0, 265)
- template.Name = "template"
- template.Parent = sections
- template.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- template.BackgroundTransparency = 1.000
- template.Position = UDim2.new(0, 50, 0, 0)
- template.Size = UDim2.new(0, 177, 0, 266)
- template.Visible = false
- template.Image = "rbxassetid://3570695787"
- template.ScaleType = Enum.ScaleType.Slice
- template.SliceCenter = Rect.new(100, 100, 100, 100)
- template.SliceScale = 0.060
- _G.SECTION = template
- top.Name = "top"
- top.Parent = template
- top.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- top.BackgroundTransparency = 1.000
- top.Position = UDim2.new(-6.85788279e-07, 0, 0, 0)
- top.Size = UDim2.new(0, 177, 0, 25)
- top.Image = "rbxassetid://3570695787"
- top.ImageColor3 = Color3.fromRGB(44, 44, 44)
- top.ScaleType = Enum.ScaleType.Slice
- top.SliceCenter = Rect.new(100, 100, 100, 100)
- top.SliceScale = 0.060
- shadow.Name = "shadow"
- shadow.Parent = top
- shadow.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- shadow.BorderSizePixel = 0
- shadow.Position = UDim2.new(1.37157656e-06, 0, 0.680000007, 0)
- shadow.Size = UDim2.new(0, 177, 0, 16)
- shadowgradiant.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(44, 44, 44)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(56, 56, 56))}
- shadowgradiant.Rotation = 90
- shadowgradiant.Name = "shadowgradiant"
- shadowgradiant.Parent = shadow
- title.Name = "title"
- title.Parent = top
- title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- title.BackgroundTransparency = 1.000
- title.BorderSizePixel = 0
- title.Position = UDim2.new(1.37157656e-06, 0, 0, 0)
- title.Size = UDim2.new(0, 177, 0, 25)
- title.Font = Enum.Font.Gotham
- title.Text = "TechHub"
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- title.TextSize = 20.000
- title.TextWrapped = true
- grad.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(44, 44, 44)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(56, 56, 56))}
- grad.Rotation = 270
- grad.Name = "grad"
- grad.Parent = template
- main.Name = "main"
- main.Parent = template
- main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- main.BackgroundTransparency = 1.000
- main.BorderSizePixel = 0
- main.Position = UDim2.new(0, 0, 0.0950185061, 0)
- main.Size = UDim2.new(0, 177, 0, 240)
- buttonTemplate.Name = "buttonTemplate"
- buttonTemplate.Parent = main
- buttonTemplate.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- buttonTemplate.BackgroundTransparency = 1.000
- buttonTemplate.BorderSizePixel = 0
- buttonTemplate.Position = UDim2.new(0.0112997796, 0, -0.0156301036, 0)
- buttonTemplate.Size = UDim2.new(0, 176, 0, 22)
- buttonTemplate.Visible = false
- buttonTemplate.Font = Enum.Font.Gotham
- buttonTemplate.Text = "button"
- buttonTemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
- buttonTemplate.TextScaled = true
- buttonTemplate.TextSize = 14.000
- buttonTemplate.TextWrapped = true
- UIListLayout.Parent = main
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- labelTemplate.Name = "labelTemplate"
- labelTemplate.Parent = main
- labelTemplate.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- labelTemplate.BackgroundTransparency = 1.000
- labelTemplate.BorderSizePixel = 0
- labelTemplate.Position = UDim2.new(0.00564971752, 0, 0.0509259254, 0)
- labelTemplate.Size = UDim2.new(0, 176, 0, 22)
- labelTemplate.Visible = false
- labelTemplate.Font = Enum.Font.Gotham
- labelTemplate.Text = "label"
- labelTemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
- labelTemplate.TextScaled = true
- labelTemplate.TextSize = 14.000
- labelTemplate.TextWrapped = true
- boxTemplate.Name = "boxTemplate"
- boxTemplate.Parent = main
- boxTemplate.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- boxTemplate.BackgroundTransparency = 1.000
- boxTemplate.BorderSizePixel = 0
- boxTemplate.Position = UDim2.new(0.00564971752, 0, -0.0509259254, 0)
- boxTemplate.Size = UDim2.new(0, 176, 0, 22)
- boxTemplate.Visible = false
- boxTemplate.Font = Enum.Font.Gotham
- boxTemplate.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
- boxTemplate.PlaceholderText = "box"
- boxTemplate.Text = ""
- boxTemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
- boxTemplate.TextScaled = true
- boxTemplate.TextSize = 18.000
- boxTemplate.TextWrapped = true
- dropdownTemplate.Name = "dropdownTemplate"
- dropdownTemplate.Parent = main
- dropdownTemplate.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- dropdownTemplate.BackgroundTransparency = 1.000
- dropdownTemplate.BorderSizePixel = 0
- dropdownTemplate.Position = UDim2.new(0.0112997796, 0, -0.0156301036, 0)
- dropdownTemplate.Size = UDim2.new(0, 176, 0, 22)
- dropdownTemplate.Visible = false
- dropdownTemplate.Font = Enum.Font.Gotham
- dropdownTemplate.Text = "dropdown"
- dropdownTemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
- dropdownTemplate.TextScaled = true
- dropdownTemplate.TextSize = 14.000
- dropdownTemplate.TextWrapped = true
- dropdownTemplate.TextXAlignment = Enum.TextXAlignment.Left
- openClose.Name = "openClose"
- openClose.Parent = dropdownTemplate
- openClose.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- openClose.BackgroundTransparency = 1.000
- openClose.BorderSizePixel = 0
- openClose.Position = UDim2.new(0.880681813, 0, 0, 0)
- openClose.Rotation = 180.000
- openClose.Size = UDim2.new(0, 22, 0, 22)
- openClose.Font = Enum.Font.Code
- openClose.Text = "^"
- openClose.TextColor3 = Color3.fromRGB(255, 255, 255)
- openClose.TextScaled = true
- openClose.TextSize = 14.000
- openClose.TextWrapped = true
- openClose.TextYAlignment = Enum.TextYAlignment.Bottom
- dropdown.Name = "dropdown"
- dropdown.Parent = dropdownTemplate
- dropdown.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- dropdown.BackgroundTransparency = 1.000
- dropdown.BorderSizePixel = 0
- dropdown.Position = UDim2.new(-0.00568181835, 0, 1, 0)
- dropdown.Size = UDim2.new(0, 177, 0, 218)
- if not tonumber(_G.SECTIONS) then _G.SECTIONS = 0 end
- _G.SECTIONS = _G.SECTIONS + 1
- repeat wait() until _G.SECTION
- local section = _G.SECTION:Clone()
- section.Parent = _G.SECTION.Parent
- section.Position = UDim2.new(-0.18, _G.SECTIONS * 200, 0, 0)
- section.Name = sectionName
- section.Visible = true
- section.Active = true section.Draggable = true
- section.top.title.Text = sectionName
- local tween = game:GetService("TweenService")
- local ishover = false
- section.MouseLeave:Connect(function()
- ishover = false
- tween:Create(section, TweenInfo.new(.5), {ImageTransparency=.65}):Play()
- tween:Create(section.top, TweenInfo.new(.5), {ImageTransparency=.65}):Play()
- for a,b in pairs(section['main']:GetChildren()) do
- if b:IsA("TextButton") or b:IsA("TextLabel") or b:IsA("TextBox") then
- tween:Create(b, TweenInfo.new(.5), {TextTransparency=.65}):Play()
- end
- end
- for a,b in pairs(section.top:GetChildren()) do
- if b:IsA("Frame") then
- tween:Create(b, TweenInfo.new(.5), {BackgroundTransparency=.65}):Play()
- end
- if b:IsA("TextLabel") then
- tween:Create(b, TweenInfo.new(.5), {TextTransparency=.65}):Play()
- end
- end
- end)
- section.MouseEnter:Connect(function()
- ishover = true
- tween:Create(section, TweenInfo.new(.5), {ImageTransparency=0}):Play()
- tween:Create(section.top, TweenInfo.new(.5), {ImageTransparency=0}):Play()
- for a,b in pairs(section['main']:GetChildren()) do
- if b:IsA("TextButton") or b:IsA("TextLabel") or b:IsA("TextBox") then
- tween:Create(b, TweenInfo.new(.5), {TextTransparency=0}):Play()
- end
- end
- for a,b in pairs(section.top:GetChildren()) do
- if b:IsA("Frame") then
- tween:Create(b, TweenInfo.new(.5), {BackgroundTransparency=0}):Play()
- end
- if b:IsA("TextLabel") then
- tween:Create(b, TweenInfo.new(.5), {TextTransparency=0}):Play()
- end
- end
- end)
- local objectlibrary = {}
- function objectlibrary:CreateButton(buttonName)
- local button = section.main.buttonTemplate:Clone()
- button.Parent = section.main
- button.Name = buttonName
- button.Text = buttonName
- button.Visible = true
- return button
- end
- function objectlibrary:CreateLabel(labelName)
- local label = section.main.labelTemplate:Clone()
- label.Parent = section.main
- label.Name = labelName
- label.Text = labelName
- label.Visible = true
- return label
- end
- function objectlibrary:CreateBox(boxName)
- local box = section.main.boxTemplate:Clone()
- box.Parent = section.main
- box.Name = boxName
- box.Text = ''
- box.PlaceholderText = boxName
- box.Visible = true
- return box
- end
- function objectlibrary:CreateDropdown(dropdownName, size, buttons)
- local open = false
- local button = section.main.dropdownTemplate:Clone()
- button.Parent = section.main
- button.Name = dropdownName
- button.Text = dropdownName
- button.Visible = true
- button.dropdown.Visible = false
- local sizeX = size.X.Offset
- local sizeY = size.Y.Offset
- local ddSize = button.dropdown.Size
- ddSize = UDim2.new(0, sizeX, 0, 0)
- local openTween = tween:Create(button.dropdown, TweenInfo.new(.3), {Size=size})
- local closeTween = tween:Create(button.dropdown, TweeinInfo.new(.3), {Size=UDim2.new(0, sizeX, 0, 0)})
- button.openClose.MouseButton1Click:connect(function()
- open = not open
- if open == true then
- button.openClose.Rotation = 0
- button.dropdown.Visible = true
- --[[for a,b in pairs(button.dropdown:GetDescendants()) do
- local a,h = pcall(function()
- if b['Visible'] then
- return true
- else
- return false
- end
- end)
- if h == true then
- b.Visible = true
- end
- end]]
- openTween:Play()
- closeTween:Cancel()
- elseif open == false then
- button.openClose.Rotation = 180
- closeTween:Play()
- openTween:Cancel()
- wait(.3)
- if open == false then
- button.dropdown.Visible = true
- --[[for a,b in pairs(button.dropdown:GetDescendants()) do
- local a,h = pcall(function()
- if b['Visible'] then
- return true
- else
- return false
- end
- end)
- if h == true then
- b.Visible = false
- end
- end]]
- end
- end
- end)
- local _buttons
- if typeof(buttons) == 'table' then _buttons = buttons else _buttons = {buttons} end
- for a,b in pairs(_buttons) do
- local clone = button.dropdown.dropdownTemplate:Clone()
- clone.Parent = button.dropdown
- clone.Visible = open
- b:Destroy()
- end
- return button
- end
- return objectlibrary
- end
- return sectionlibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement