Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lib = {}
- local UIS = game:GetService("UserInputService")
- function dragify(Frame)
- dragToggle = nil
- local dragSpeed = 10
- dragInput = nil
- dragStart = nil
- local dragPos = nil
- 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(0.25), {Position = Position}):Play()
- end
- Frame.InputBegan:Connect(function(input)
- if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and UIS:GetFocusedTextBox() == nil 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 lib:CreateMain(uiname)
- local main = Instance.new("ScreenGui")
- local mainframe = Instance.new("Frame")
- local tabs = Instance.new("Frame")
- local tabholder = Instance.new("Frame")
- local UIListLayout = Instance.new("UIListLayout")
- local borderline = Instance.new("Frame")
- local borderline_2 = Instance.new("Frame")
- local borderline_3 = Instance.new("Frame")
- local name = Instance.new("TextLabel")
- local tabframeholder = Instance.new('Folder')
- local open = main
- main.Name = "main"
- main.Parent = game.CoreGui
- mainframe.Name = "mainframe"
- mainframe.Parent = main
- mainframe.BackgroundColor3 = Color3.new(0.164706, 0.164706, 0.164706)
- mainframe.BorderColor3 = Color3.new(0.105882, 0.105882, 0.105882)
- mainframe.BorderSizePixel = 2
- mainframe.Position = UDim2.new(0, 169, 0, 102)
- mainframe.Size = UDim2.new(0, 575, 0, 275)
- dragify(mainframe)
- borderline_3.Name = "borderline"
- borderline_3.Parent = mainframe
- borderline_3.BackgroundColor3 = Color3.new(0.203922, 0.203922, 0.203922)
- borderline_3.BorderSizePixel = 0
- borderline_3.Position = UDim2.new(-0.00178891385, 0, 0.10095942, 0)
- borderline_3.Size = UDim2.new(0, 124, 0, 5)
- borderline_3.ZIndex = 2
- tabs.Name = "tabs"
- tabs.Parent = mainframe
- tabs.BackgroundColor3 = Color3.new(0.172549, 0.172549, 0.172549)
- tabs.BorderSizePixel = 0
- tabs.Position = UDim2.new(0.00408165762, 0, 0.119409539, 0)
- tabs.Size = UDim2.new(0, 116, 0, 238)
- tabholder.Name = "tabholder"
- tabholder.Parent = tabs
- tabholder.BackgroundColor3 = Color3.new(1, 1, 1)
- tabholder.BackgroundTransparency = 1
- tabholder.Position = UDim2.new(-0.00862068962, 0, 0.018018065, 0)
- tabholder.Size = UDim2.new(0, 121, 0, 237)
- UIListLayout.Parent = tabholder
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- borderline.Name = "borderline_1"
- borderline.Parent = mainframe
- borderline.BackgroundColor3 = Color3.new(0.203922, 0.203922, 0.203922)
- borderline.BorderSizePixel = 0
- borderline.Position = UDim2.new(0.213887751, 0, 0, 0)
- borderline.Size = UDim2.new(0, 5, 0, 271)
- borderline.ZIndex = 2
- borderline_2.Name = "borderline_2"
- borderline_2.Parent = mainframe
- borderline_2.BackgroundColor3 = Color3.new(0.203922, 0.203922, 0.203922)
- borderline_2.BorderSizePixel = 0
- borderline_2.Position = UDim2.new(0.221223041, 0, 0.0825092122, 0)
- borderline_2.Size = UDim2.new(0, 447, 0, 5)
- borderline_2.ZIndex = 2
- name.Name = "name"
- name.Parent = mainframe
- name.BackgroundColor3 = Color3.new(1, 1, 1)
- name.BackgroundTransparency = 1
- name.Size = UDim2.new(0, 117, 0, 27)
- name.ZIndex = 2
- name.Font = Enum.Font.GothamSemibold
- name.Text = uiname
- name.TextColor3 = Color3.new(1, 1, 1)
- name.TextSize = 15
- tabframeholder.Name = 'tabframeholder'
- tabframeholder.Parent = mainframe
- local sectionlibrary = {}
- local sectionCount = 0
- function sectionlibrary:CreateSection(sectionname)
- local tab = Instance.new("TextButton")
- local tabframe = Instance.new("ScrollingFrame")
- local tabline = Instance.new("Frame")
- local UIPadding = Instance.new("UIPadding")
- local UIListLayout = Instance.new('UIListLayout')
- tab.Name = tostring(sectionname)
- tab.Parent = tabholder
- tab.BackgroundColor3 = Color3.new(1, 1, 1)
- tab.BackgroundTransparency = 1
- tab.Position = UDim2.new(-0.00862068962, 0, 0.227731258, 0)
- tab.Size = UDim2.new(0, 117, 0, 28)
- tab.Font = Enum.Font.Gotham
- tab.Text = sectionname
- tab.TextColor3 = Color3.new(1, 1, 1)
- tab.TextSize = 14
- tabframe.Name = tostring(sectionname)
- tabframe.Parent = tabframeholder
- tabframe.BackgroundColor3 = Color3.new(1, 1, 1)
- tabframe.BackgroundTransparency = 1
- tabframe.ClipsDescendants = true
- tabframe.Visible = true
- tabframe.CanvasSize = UDim2.new(0, 0, 0, 100)
- tabframe.ScrollBarThickness = 4
- tabframe.Position = UDim2.new(0.222832292, 0, 0.100959472, 0)
- tabframe.Size = UDim2.new(0, 446, 0, 247)
- tabline.Name = "tabline"
- tabline.Parent = tab
- tabline.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- tabline.BorderSizePixel = 0
- tabline.Position = UDim2.new(0.102564104, 0, 0.142857134, 0)
- tabline.Size = UDim2.new(0, 2, 0, 20)
- UIListLayout.Parent = tabframe
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- UIListLayout.Padding = UDim.new(0.01, 0)
- UIPadding.Parent = tabframe
- UIPadding.PaddingLeft = UDim.new(0, 25)
- UIPadding.PaddingTop = UDim.new(0, 5)
- if sectionCount == 0 then
- tabframe:TweenSize(UDim2.new(0, 446, 0, 247), "Out", "Quad", 1, false, nil)
- tabline:TweenSize(UDim2.new(0, 2, 0, 20), "Out", "Quad", 0.3, false, nil)
- else
- tabline.Size = UDim2.new(0, 2, 0, 0)
- tabframe.Size = UDim2.new(0, 409, 0, 0)
- end
- sectionCount = sectionCount + 1
- tab.MouseButton1Click:Connect(function()
- for i, v in pairs(main.mainframe.tabframeholder:GetChildren()) do
- if v.Name ~= tostring(sectionname) then
- v:TweenSize(UDim2.new(0, 409, 0, 0), "Out", "Quad", 0.7, false, nil)
- end
- end
- for i, v in pairs(main.mainframe.tabs.tabholder:GetChildren()) do
- if v:IsA("TextButton") and v.Name ~= tostring(sectionname) then
- v.tabline:TweenSize(UDim2.new(0, 2, 0, 0), "Out", "Quad", 0.3, false, nil)
- end
- end
- wait(0.9)
- main.mainframe.tabframeholder[tostring(sectionname)]:TweenSize(UDim2.new(0, 446, 0, 247), "Out", "Quad", 1, false, nil)
- main.mainframe.tabs.tabholder[tostring(sectionname)].tabline:TweenSize(UDim2.new(0, 2, 0, 20), "Out", "Quad", 0.3, false, nil)
- end)
- return sectionlibrary;
- end
- return lib;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement