Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local library = { windows = 0, flagamnt=1 }
- local ui = Instance.new("ScreenGui",game:GetService("CoreGui"))
- function Create(obj, parent, args)
- local Item = Instance.new(obj, parent)
- for i, v in pairs(args) do
- Item[i] = v
- end
- return Item
- end
- function library:CreateWindow(text, description, frametext)
- local tab = { itemcount = 1, openframe = false, flags = {} }
- local Title = Create("TextButton", ui, { Size = UDim2.new(0, 190, 0, 32), Text = " " .. text, BackgroundColor3 = Color3.fromRGB(30, 30, 30), BorderSizePixel = 0, TextColor3 = Color3.fromRGB(255, 255, 255), TextSize = 18, Font = Enum.Font.SourceSans, TextXAlignment = "Left", ZIndex = 2, Position = UDim2.new(0, 10 + (library.windows * 200), 0, 10) })
- local Description = Create("TextLabel", ui, { Size = UDim2.new(0, 190, 0, 32), Text = description, BackgroundColor3 = Color3.fromRGB(30, 30, 30), BorderSizePixel = 0, TextColor3 = Color3.fromRGB(255, 255, 255), TextSize = 18, Font = Enum.Font.SourceSans, Position = UDim2.new(0, 10 + (library.windows * 200), 0, 10) })
- local Frame = Create("Frame", ui, { Size = UDim2.new(0, 0, 0, 0), BorderSizePixel = 0, BackgroundColor3 = Color3.fromRGB(30, 30, 30), Position = UDim2.new(0, 10 + (library.windows * 200), 0, 50), ClipsDescendants = true })
- local FrameTitle = Create("TextLabel", Frame, { Size = UDim2.new(0, 190, 0, 32), BorderSizePixel = 0, BackgroundColor3 = Color3.fromRGB(25, 25, 25), TextColor3 = Color3.fromRGB(255, 255, 255), Text = frametext, TextSize = 18, Font = Enum.Font.SourceSans })
- local num = library.windows
- Title.MouseEnter:Connect(function()
- if tab.openframe == false then
- Description:TweenPosition(UDim2.new(0, 10 + (num * 200), 0, 50), "Out", "Quint", 0.3)
- end
- end)
- Title.MouseLeave:Connect(function()
- Description:TweenPosition(UDim2.new(0, 10 + (num * 200), 0, 10), "Out", "Quint", 0.3)
- end)
- Title.MouseButton1Click:Connect(function()
- if tab.openframe == false then
- Description:TweenPosition(UDim2.new(0, 10 + (num * 200), 0, 10), "Out", "Quint", 0.3)
- Frame:TweenSize(UDim2.new(0, 190, 0, tab.itemcount * 32), "Out", "Quint", 0.3)
- tab.openframe = true
- else
- Frame:TweenSize(UDim2.new(0, 190, 0, 0), "Out", "Quint", 0.3)
- tab.openframe = false
- end
- end)
- function tab:CreateButton(text, func)
- local Btn = Create("TextButton", Frame, { Size = UDim2.new(0, 190, 0, 32), Position = UDim2.new(0, 0, 0, 32 * tab.itemcount), BackgroundColor3 = Color3.fromRGB(20, 20, 20), BorderSizePixel = 0, TextColor3 = Color3.fromRGB(255, 255, 255), Font = Enum.Font.SourceSans, Text = text, TextSize = 18 })
- Btn.MouseButton1Click:Connect(func)
- tab.itemcount = tab.itemcount + 1
- return Btn
- end
- function tab:CreateSection(text)
- local sct = Create("TextLabel", Frame, { Size = UDim2.new(0, 190, 0, 32), Position = UDim2.new(0, 0, 0, 32 * tab.itemcount), BackgroundColor3 = Color3.fromRGB(18, 18, 18), BorderSizePixel = 0, TextColor3 = Color3.fromRGB(255, 255, 255), Font = Enum.Font.SourceSans, Text = text, TextSize = 18 })
- tab.itemcount = tab.itemcount + 1
- return sct
- end
- function tab:CreateLabel(text)
- local lbl = Create("TextLabel", Frame, { Size = UDim2.new(0, 190, 0, 32), Position = UDim2.new(0, 0, 0, 32 * tab.itemcount), BackgroundColor3 = Color3.fromRGB(30, 30, 30), BorderSizePixel = 0, TextColor3 = Color3.fromRGB(255, 255, 255), Font = Enum.Font.SourceSans, Text = " " .. text, TextSize = 18, TextXAlignment = "Left" })
- tab.itemcount = tab.itemcount + 1
- return lbl
- end
- function tab:CreateToggle(text, func)
- local tgl = Create("TextButton", Frame, { Size = UDim2.new(0, 32, 0, 32), Position = UDim2.new(0, 160, 0, 32 * tab.itemcount), BackgroundColor3 = Color3.fromRGB(18, 18, 18), BorderSizePixel = 0, TextColor3 = Color3.fromRGB(255, 255, 255), Font = Enum.Font.SourceSans, Text = "", TextSize = 18, ZIndex = 2 })
- local label = Create("TextLabel", Frame, { Size = UDim2.new(0, 190, 0, 32), Position = UDim2.new(0, 5, 0, 32 * tab.itemcount), BackgroundColor3 = Color3.fromRGB(30, 30, 30), BorderSizePixel = 0, TextColor3 = Color3.fromRGB(255, 255, 255), Font = Enum.Font.SourceSans, Text = " " .. text, TextSize = 18, TextXAlignment = "Left"})
- local num = tab.itemcount
- tab.flags[num] = false
- tgl.MouseButton1Click:Connect(function()
- tab.flags[num] = not tab.flags[num]
- if tab.flags[num] == false then
- tgl.Text = ""
- else
- tgl.Text = "✓"
- end
- func(tab.flags[num])
- end)
- tab.itemcount = tab.itemcount + 1
- return tgl
- end
- library.windows = library.windows + 1
- return tab
- end
- return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement