Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uiLibraryCode = [[
- local UI = {}
- function UI:CreateWindow(title)
- local ScreenGui = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local TitleLabel = Instance.new("TextLabel")
- ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- Frame.Parent = ScreenGui
- Frame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- Frame.Size = UDim2.new(0, 300, 0, 200)
- Frame.Position = UDim2.new(0.5, -150, 0.5, -100)
- Frame.AnchorPoint = Vector2.new(0.5, 0.5)
- TitleLabel.Parent = Frame
- TitleLabel.BackgroundTransparency = 1
- TitleLabel.Size = UDim2.new(1, 0, 0, 50)
- TitleLabel.Text = title
- TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- TitleLabel.TextScaled = true
- TitleLabel.TextStrokeTransparency = 0.5
- return Frame
- end
- function UI:CreateButton(parent, text, callback)
- local Button = Instance.new("TextButton")
- Button.Parent = parent
- Button.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- Button.Size = UDim2.new(0, 200, 0, 50)
- Button.Text = text
- Button.TextColor3 = Color3.fromRGB(255, 255, 255)
- Button.TextScaled = true
- -- Mengatur posisi tombol secara otomatis
- local buttonCount = #parent:GetChildren() - 1 -- Menghitung jumlah tombol yang ada
- Button.Position = UDim2.new(0.5, -100, 0.5, (buttonCount * 60) - 25) -- Mengatur posisi berdasarkan jumlah tombol
- Button.MouseButton1Click:Connect(callback)
- return Button
- end
- return UI
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement