Messi33536086

Untitled

Jun 12th, 2025
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.25 KB | None | 0 0
  1. local MartinUI = {}
  2. local TweenService = game:GetService("TweenService")
  3. local UserInputService = game:GetService("UserInputService")
  4. local HttpService = game:GetService("HttpService")
  5.  
  6. function MartinUI:Create(config)
  7. local MartinScreenGui = Instance.new("ScreenGui", game.CoreGui)
  8. MartinScreenGui.Name = "MartinUI"
  9. MartinScreenGui.ResetOnSpawn = false
  10.  
  11. local MainFrame = Instance.new("Frame", MartinScreenGui)
  12. MainFrame.Size = UDim2.new(0, 500, 0, 300)
  13. MainFrame.Position = UDim2.new(0.5, -250, 0.5, -150)
  14. MainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  15. MainFrame.BorderSizePixel = 0
  16. MainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  17. MainFrame.Active = true
  18. MainFrame.Draggable = true
  19.  
  20. local Title = Instance.new("TextLabel", MainFrame)
  21. Title.Size = UDim2.new(1, 0, 0, 40)
  22. Title.BackgroundTransparency = 1
  23. Title.Text = config and config.Title or "Martin UI"
  24. Title.Font = Enum.Font.SourceSansBold
  25. Title.TextSize = 22
  26. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  27.  
  28. local Scroller = Instance.new("ScrollingFrame", MainFrame)
  29. Scroller.Size = UDim2.new(1, -20, 1, -50)
  30. Scroller.Position = UDim2.new(0, 10, 0, 45)
  31. Scroller.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  32. Scroller.BorderSizePixel = 0
  33. Scroller.ScrollBarThickness = 6
  34. Scroller.CanvasSize = UDim2.new(0, 0, 0, 0)
  35. Scroller.AutomaticCanvasSize = Enum.AutomaticSize.Y
  36. Scroller.AutomaticSize = Enum.AutomaticSize.None
  37.  
  38. local UIList = Instance.new("UIListLayout", Scroller)
  39. UIList.Padding = UDim.new(0, 8)
  40. UIList.SortOrder = Enum.SortOrder.LayoutOrder
  41.  
  42. -- زرار
  43. function MartinUI:Button(text, callback)
  44. local Btn = Instance.new("TextButton", Scroller)
  45. Btn.Size = UDim2.new(1, -10, 0, 40)
  46. Btn.Text = text
  47. Btn.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  48. Btn.TextColor3 = Color3.fromRGB(255, 255, 255)
  49. Btn.Font = Enum.Font.SourceSans
  50. Btn.TextSize = 18
  51. Btn.BorderSizePixel = 0
  52. Btn.MouseButton1Click:Connect(function()
  53. pcall(callback)
  54. end)
  55. end
  56.  
  57. -- سلايدر
  58. function MartinUI:Slider(name, min, max, default, callback)
  59. local Holder = Instance.new("Frame", Scroller)
  60. Holder.Size = UDim2.new(1, -10, 0, 50)
  61. Holder.BackgroundTransparency = 1
  62.  
  63. local Label = Instance.new("TextLabel", Holder)
  64. Label.Size = UDim2.new(1, 0, 0, 20)
  65. Label.Text = name .. ": " .. tostring(default)
  66. Label.TextColor3 = Color3.fromRGB(255, 255, 255)
  67. Label.Font = Enum.Font.SourceSans
  68. Label.TextSize = 18
  69. Label.BackgroundTransparency = 1
  70.  
  71. local Slider = Instance.new("TextButton", Holder)
  72. Slider.Size = UDim2.new(1, 0, 0, 20)
  73. Slider.Position = UDim2.new(0, 0, 0, 25)
  74. Slider.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  75. Slider.Text = ""
  76. Slider.BorderSizePixel = 0
  77.  
  78. local Fill = Instance.new("Frame", Slider)
  79. Fill.Size = UDim2.new((default - min) / (max - min), 0, 1, 0)
  80. Fill.BackgroundColor3 = Color3.fromRGB(100, 100, 255)
  81. Fill.BorderSizePixel = 0
  82.  
  83. local dragging = false
  84. Slider.InputBegan:Connect(function(input)
  85. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  86. dragging = true
  87. end
  88. end)
  89. UserInputService.InputEnded:Connect(function(input)
  90. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  91. dragging = false
  92. end
  93. end)
  94. UserInputService.InputChanged:Connect(function(input)
  95. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  96. local percent = math.clamp((input.Position.X - Slider.AbsolutePosition.X) / Slider.AbsoluteSize.X, 0, 1)
  97. local value = math.floor(min + (max - min) * percent)
  98. Fill.Size = UDim2.new(percent, 0, 1, 0)
  99. Label.Text = name .. ": " .. tostring(value)
  100. pcall(callback, value)
  101. end
  102. end)
  103. end
  104.  
  105. -- TextBox
  106. function MartinUI:TextBox(placeholder, callback)
  107. local Box = Instance.new("TextBox", Scroller)
  108. Box.Size = UDim2.new(1, -10, 0, 40)
  109. Box.Text = ""
  110. Box.PlaceholderText = placeholder
  111. Box.Font = Enum.Font.SourceSans
  112. Box.TextSize = 18
  113. Box.TextColor3 = Color3.fromRGB(255, 255, 255)
  114. Box.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  115. Box.BorderSizePixel = 0
  116. Box.FocusLost:Connect(function()
  117. pcall(callback, Box.Text)
  118. end)
  119. end
  120.  
  121. -- Dropdown
  122. function MartinUI:Dropdown(title, items, callback)
  123. local Holder = Instance.new("Frame", Scroller)
  124. Holder.Size = UDim2.new(1, -10, 0, 40 + (#items * 30))
  125. Holder.BackgroundTransparency = 1
  126.  
  127. local Main = Instance.new("TextButton", Holder)
  128. Main.Size = UDim2.new(1, 0, 0, 40)
  129. Main.Text = title .. " ▼"
  130. Main.Font = Enum.Font.SourceSans
  131. Main.TextSize = 18
  132. Main.TextColor3 = Color3.fromRGB(255, 255, 255)
  133. Main.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  134. Main.BorderSizePixel = 0
  135.  
  136. local Open = false
  137. for i, v in ipairs(items) do
  138. local Btn = Instance.new("TextButton", Holder)
  139. Btn.Size = UDim2.new(1, 0, 0, 30)
  140. Btn.Position = UDim2.new(0, 0, 0, 40 + (i - 1) * 30)
  141. Btn.Text = v
  142. Btn.Visible = false
  143. Btn.Font = Enum.Font.SourceSans
  144. Btn.TextSize = 16
  145. Btn.TextColor3 = Color3.fromRGB(255, 255, 255)
  146. Btn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  147. Btn.BorderSizePixel = 0
  148. Btn.MouseButton1Click:Connect(function()
  149. Main.Text = title .. ": " .. v
  150. for _, btn in ipairs(Holder:GetChildren()) do
  151. if btn:IsA("TextButton") and btn ~= Main then
  152. btn.Visible = false
  153. end
  154. end
  155. Open = false
  156. pcall(callback, v)
  157. end)
  158. end
  159.  
  160. Main.MouseButton1Click:Connect(function()
  161. Open = not Open
  162. for _, btn in ipairs(Holder:GetChildren()) do
  163. if btn:IsA("TextButton") and btn ~= Main then
  164. btn.Visible = Open
  165. end
  166. end
  167. end)
  168. end
  169.  
  170. -- Notification
  171. function MartinUI:Notify(msg, time)
  172. local Note = Instance.new("TextLabel", MainFrame)
  173. Note.Size = UDim2.new(0, 300, 0, 30)
  174. Note.Position = UDim2.new(0.5, -150, 0, -40)
  175. Note.Text = msg
  176. Note.Font = Enum.Font.SourceSans
  177. Note.TextSize = 18
  178. Note.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  179. Note.TextColor3 = Color3.fromRGB(255, 255, 255)
  180. Note.BorderSizePixel = 0
  181.  
  182. TweenService:Create(Note, TweenInfo.new(0.4), {Position = UDim2.new(0.5, -150, 0, 10)}):Play()
  183. wait(time or 2)
  184. TweenService:Create(Note, TweenInfo.new(0.4), {Position = UDim2.new(0.5, -150, 0, -40)}):Play()
  185. wait(0.4)
  186. Note:Destroy()
  187. end
  188.  
  189. return MartinUI
  190. end
  191.  
  192. return MartinUI
Advertisement
Add Comment
Please, Sign In to add comment