Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- OrionLib.lua
- local OrionLib = {}
- OrionLib.__index = OrionLib
- function OrionLib.new()
- local self = setmetatable({}, OrionLib)
- -- Criar a tela principal
- self.MainFrame = Instance.new("Frame")
- self.MainFrame.Size = UDim2.new(0, 400, 0, 300)
- self.MainFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
- self.MainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- self.MainFrame.BorderSizePixel = 0
- self.MainFrame.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- -- Cantos arredondados
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 10)
- corner.Parent = self.MainFrame
- -- Criar um título
- self.TitleLabel = Instance.new("TextLabel")
- self.TitleLabel.Size = UDim2.new(1, 0, 0, 50)
- self.TitleLabel.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
- self.TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- self.TitleLabel.Text = "OrionLib"
- self.TitleLabel.Parent = self.MainFrame
- self.TitleLabel.TextScaled = true
- -- Botão de fechar
- local closeButton = Instance.new("TextButton")
- closeButton.Size = UDim2.new(0, 30, 0, 30)
- closeButton.Position = UDim2.new(1, -35, 0, 10) -- Ajuste para o canto superior direito
- closeButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.Text = "X"
- closeButton.Parent = self.MainFrame
- closeButton.MouseButton1Click:Connect(function()
- self.MainFrame.Visible = false
- end)
- -- Botão de minimizar
- local minimizeButton = Instance.new("TextButton")
- minimizeButton.Size = UDim2.new(0, 30, 0, 30)
- minimizeButton.Position = UDim2.new(1, -70, 0, 10) -- Ajuste para o canto superior direito
- minimizeButton.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
- minimizeButton.TextColor3 = Color3.fromRGB(0, 0, 0)
- minimizeButton.Text = "_"
- minimizeButton.Parent = self.MainFrame
- minimizeButton.MouseButton1Click:Connect(function()
- self.MainFrame.Size = UDim2.new(0, 400, 0, 50) -- Minimiza para altura de 50
- end)
- -- Função de arrastar
- local dragging = false
- local dragInput
- local startPos
- self.TitleLabel.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- startPos = input.Position - self.MainFrame.Position
- dragInput = input
- end
- end)
- self.TitleLabel.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
- self.MainFrame.Position = UDim2.new(0, input.Position.X - startPos.X, 0, input.Position.Y - startPos.Y)
- end
- end)
- self.TitleLabel.InputEnded:Connect(function(input)
- if input == dragInput then
- dragging = false
- end
- end)
- return self
- end
- function OrionLib:MakeButton(name, callback)
- local button = Instance.new("TextButton")
- button.Size = UDim2.new(0, 150, 0, 50)
- button.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- button.TextColor3 = Color3.fromRGB(0, 0, 0)
- button.Text = name
- button.Parent = self.MainFrame
- button.MouseButton1Click:Connect(callback)
- end
- function OrionLib:MakeToggle(name, callback)
- local toggleFrame = Instance.new("Frame")
- toggleFrame.Size = UDim2.new(0, 150, 0, 50)
- toggleFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- toggleFrame.Parent = self.MainFrame
- local toggleLabel = Instance.new("TextLabel")
- toggleLabel.Size = UDim2.new(0, 100, 0, 50)
- toggleLabel.Text = name
- toggleLabel.Parent = toggleFrame
- local toggleButton = Instance.new("TextButton")
- toggleButton.Size = UDim2.new(0, 50, 0, 50)
- toggleButton.Position = UDim2.new(1, 0, 0, 0)
- toggleButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- toggleButton.Text = "OFF"
- toggleButton.Parent = toggleFrame
- local isToggled = false
- toggleButton.MouseButton1Click:Connect(function()
- isToggled = not isToggled
- toggleButton.Text = isToggled and "ON" or "OFF"
- toggleButton.BackgroundColor3 = isToggled and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
- callback(isToggled)
- end)
- end
- function OrionLib:MakeNotification(data)
- local notification = Instance.new("ScreenGui", game.Players.LocalPlayer:WaitForChild("PlayerGui"))
- local frame = Instance.new("Frame", notification)
- frame.Size = UDim2.new(0, 300, 0, 100)
- frame.Position = UDim2.new(0.5, -150, 0.5, -50)
- frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- frame.BackgroundTransparency = 0.5
- local titleLabel = Instance.new("TextLabel", frame)
- titleLabel.Size = UDim2.new(1, 0, 0, 30)
- titleLabel.Text = data.Name
- titleLabel.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
- titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- local contentLabel = Instance.new("TextLabel", frame)
- contentLabel.Size = UDim2.new(1, 0, 0, 70)
- contentLabel.Position = UDim2.new(0, 0, 0, 30)
- contentLabel.Text = data.Content
- contentLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- contentLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- wait(data.Time)
- notification:Destroy()
- end
- function OrionLib:MakeTab(tabData)
- -- Método para criar uma nova aba (ainda não implementado)
- -- Você pode implementar sua própria lógica aqui, se necessário
- end
- function OrionLib:Init()
- self.MainFrame.Visible = true
- end
- return OrionLib
Advertisement
Add Comment
Please, Sign In to add comment