Ameno__GodOH

oriongpt

Oct 14th, 2024 (edited)
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.56 KB | None | 0 0
  1. -- OrionLib.lua
  2. local OrionLib = {}
  3. OrionLib.__index = OrionLib
  4.  
  5. function OrionLib.new()
  6. local self = setmetatable({}, OrionLib)
  7.  
  8. -- Criar a tela principal
  9. self.MainFrame = Instance.new("Frame")
  10. self.MainFrame.Size = UDim2.new(0, 400, 0, 300)
  11. self.MainFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
  12. self.MainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  13. self.MainFrame.BorderSizePixel = 0
  14. self.MainFrame.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  15.  
  16. -- Cantos arredondados
  17. local corner = Instance.new("UICorner")
  18. corner.CornerRadius = UDim.new(0, 10)
  19. corner.Parent = self.MainFrame
  20.  
  21. -- Criar um título
  22. self.TitleLabel = Instance.new("TextLabel")
  23. self.TitleLabel.Size = UDim2.new(1, 0, 0, 50)
  24. self.TitleLabel.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
  25. self.TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  26. self.TitleLabel.Text = "OrionLib"
  27. self.TitleLabel.Parent = self.MainFrame
  28. self.TitleLabel.TextScaled = true
  29.  
  30. -- Botão de fechar
  31. local closeButton = Instance.new("TextButton")
  32. closeButton.Size = UDim2.new(0, 30, 0, 30)
  33. closeButton.Position = UDim2.new(1, -35, 0, 10) -- Ajuste para o canto superior direito
  34. closeButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  35. closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  36. closeButton.Text = "X"
  37. closeButton.Parent = self.MainFrame
  38.  
  39. closeButton.MouseButton1Click:Connect(function()
  40. self.MainFrame.Visible = false
  41. end)
  42.  
  43. -- Botão de minimizar
  44. local minimizeButton = Instance.new("TextButton")
  45. minimizeButton.Size = UDim2.new(0, 30, 0, 30)
  46. minimizeButton.Position = UDim2.new(1, -70, 0, 10) -- Ajuste para o canto superior direito
  47. minimizeButton.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  48. minimizeButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  49. minimizeButton.Text = "_"
  50. minimizeButton.Parent = self.MainFrame
  51.  
  52. minimizeButton.MouseButton1Click:Connect(function()
  53. self.MainFrame.Size = UDim2.new(0, 400, 0, 50) -- Minimiza para altura de 50
  54. end)
  55.  
  56. -- Função de arrastar
  57. local dragging = false
  58. local dragInput
  59. local startPos
  60.  
  61. self.TitleLabel.InputBegan:Connect(function(input)
  62. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  63. dragging = true
  64. startPos = input.Position - self.MainFrame.Position
  65. dragInput = input
  66. end
  67. end)
  68.  
  69. self.TitleLabel.InputChanged:Connect(function(input)
  70. if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
  71. self.MainFrame.Position = UDim2.new(0, input.Position.X - startPos.X, 0, input.Position.Y - startPos.Y)
  72. end
  73. end)
  74.  
  75. self.TitleLabel.InputEnded:Connect(function(input)
  76. if input == dragInput then
  77. dragging = false
  78. end
  79. end)
  80.  
  81. return self
  82. end
  83.  
  84. function OrionLib:MakeButton(name, callback)
  85. local button = Instance.new("TextButton")
  86. button.Size = UDim2.new(0, 150, 0, 50)
  87. button.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
  88. button.TextColor3 = Color3.fromRGB(0, 0, 0)
  89. button.Text = name
  90. button.Parent = self.MainFrame
  91. button.MouseButton1Click:Connect(callback)
  92. end
  93.  
  94. function OrionLib:MakeToggle(name, callback)
  95. local toggleFrame = Instance.new("Frame")
  96. toggleFrame.Size = UDim2.new(0, 150, 0, 50)
  97. toggleFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  98. toggleFrame.Parent = self.MainFrame
  99.  
  100. local toggleLabel = Instance.new("TextLabel")
  101. toggleLabel.Size = UDim2.new(0, 100, 0, 50)
  102. toggleLabel.Text = name
  103. toggleLabel.Parent = toggleFrame
  104.  
  105. local toggleButton = Instance.new("TextButton")
  106. toggleButton.Size = UDim2.new(0, 50, 0, 50)
  107. toggleButton.Position = UDim2.new(1, 0, 0, 0)
  108. toggleButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  109. toggleButton.Text = "OFF"
  110. toggleButton.Parent = toggleFrame
  111.  
  112. local isToggled = false
  113. toggleButton.MouseButton1Click:Connect(function()
  114. isToggled = not isToggled
  115. toggleButton.Text = isToggled and "ON" or "OFF"
  116. toggleButton.BackgroundColor3 = isToggled and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
  117. callback(isToggled)
  118. end)
  119. end
  120.  
  121. function OrionLib:MakeNotification(data)
  122. local notification = Instance.new("ScreenGui", game.Players.LocalPlayer:WaitForChild("PlayerGui"))
  123. local frame = Instance.new("Frame", notification)
  124. frame.Size = UDim2.new(0, 300, 0, 100)
  125. frame.Position = UDim2.new(0.5, -150, 0.5, -50)
  126. frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  127. frame.BackgroundTransparency = 0.5
  128.  
  129. local titleLabel = Instance.new("TextLabel", frame)
  130. titleLabel.Size = UDim2.new(1, 0, 0, 30)
  131. titleLabel.Text = data.Name
  132. titleLabel.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
  133. titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  134.  
  135. local contentLabel = Instance.new("TextLabel", frame)
  136. contentLabel.Size = UDim2.new(1, 0, 0, 70)
  137. contentLabel.Position = UDim2.new(0, 0, 0, 30)
  138. contentLabel.Text = data.Content
  139. contentLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  140. contentLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  141.  
  142. wait(data.Time)
  143. notification:Destroy()
  144. end
  145.  
  146. function OrionLib:MakeTab(tabData)
  147. -- Método para criar uma nova aba (ainda não implementado)
  148. -- Você pode implementar sua própria lógica aqui, se necessário
  149. end
  150.  
  151. function OrionLib:Init()
  152. self.MainFrame.Visible = true
  153. end
  154.  
  155. return OrionLib
Advertisement
Add Comment
Please, Sign In to add comment