Messi33536086

Untitled

Oct 7th, 2025
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.40 KB | None | 0 0
  1. -- Martin UI: Wind+Luna mix, blue->purple gradient accent
  2. local TweenService = game:GetService("TweenService")
  3. local Players = game:GetService("Players")
  4. local RunService = game:GetService("RunService")
  5. local LocalPlayer = Players.LocalPlayer
  6. local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
  7. local UI = {}
  8. UI._windows = {}
  9. local Defaults = {
  10. AccentStart = Color3.fromRGB(73, 137, 255),
  11. AccentEnd = Color3.fromRGB(156, 68, 255),
  12. Background = Color3.fromRGB(12,12,12),
  13. Card = Color3.fromRGB(18,18,18),
  14. Text = Color3.fromRGB(230,230,230),
  15. Shadow = Color3.fromRGB(0,0,0),
  16. Corner = UDim.new(0,6)
  17. }
  18. local function new(name,props)
  19. local obj = Instance.new(name)
  20. for k,v in pairs(props or {}) do
  21. obj[k] = v
  22. end
  23. return obj
  24. end
  25. local function makeUICorner(parent, radius)
  26. local c = new("UICorner",{CornerRadius = radius or Defaults.Corner})
  27. c.Parent = parent
  28. return c
  29. end
  30. local function makeShadow(parent)
  31. local e = new("UIStroke",{ApplyStrokeMode = Enum.ApplyStrokeMode.Border,Thickness = 0.6,Transparency = 0.6})
  32. e.Parent = parent
  33. return e
  34. end
  35. local function tween(obj, props, time, style, dir)
  36. local info = TweenInfo.new(time or 0.2, style or Enum.EasingStyle.Quad, dir or Enum.EasingDirection.Out)
  37. local t = TweenService:Create(obj, info, props)
  38. t:Play()
  39. return t
  40. end
  41. local function addDrag(frame, dragHandle)
  42. dragHandle = dragHandle or frame
  43. local dragging, dragInput, dragStart, startPos
  44. dragHandle.InputBegan:Connect(function(input)
  45. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  46. dragging = true
  47. dragStart = input.Position
  48. startPos = frame.Position
  49. input.Changed:Connect(function()
  50. if input.UserInputState == Enum.UserInputState.End then
  51. dragging = false
  52. end
  53. end)
  54. end
  55. end)
  56. dragHandle.InputChanged:Connect(function(input)
  57. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  58. dragInput = input
  59. end
  60. end)
  61. game:GetService("UserInputService").InputChanged:Connect(function(input)
  62. if input == dragInput and dragging then
  63. local delta = input.Position - dragStart
  64. frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  65. end
  66. end)
  67. end
  68. local function createGradient(frame)
  69. local g = new("UIGradient",{})
  70. g.Color = ColorSequence.new(Defaults.AccentStart, Defaults.AccentEnd)
  71. g.Rotation = 30
  72. g.Parent = frame
  73. return g
  74. end
  75. local function makeButton(parent,text,callback)
  76. local btn = new("TextButton",{Text = text,Size = UDim2.new(1,0,0,36),BackgroundTransparency=0,BackgroundColor3=Defaults.Card,TextColor3=Defaults.Text,BorderSizePixel=0,Font=Enum.Font.GothamBold,TextSize=14,AutoButtonColor=false})
  77. makeUICorner(btn)
  78. makeShadow(btn)
  79. btn.MouseEnter:Connect(function()
  80. tween(btn,{BackgroundTransparency=0.1},0.18)
  81. end)
  82. btn.MouseLeave:Connect(function()
  83. tween(btn,{BackgroundTransparency=0},0.18)
  84. end)
  85. btn.MouseButton1Click:Connect(function()
  86. tween(btn,{BackgroundTransparency=0.2},0.06,nil,Enum.EasingDirection.In)
  87. wait(0.06)
  88. tween(btn,{BackgroundTransparency=0},0.12)
  89. pcall(callback)
  90. end)
  91. btn.Parent = parent
  92. return btn
  93. end
  94. local function makeLabel(parent,txt,size)
  95. local l = new("TextLabel",{Text=txt,Size=size or UDim2.new(1,0,0,20),BackgroundTransparency=1,TextColor3=Defaults.Text,Font=Enum.Font.Gotham,TextSize=14,TextXAlignment=Enum.TextXAlignment.Left})
  96. l.Parent = parent
  97. return l
  98. end
  99. local function createToggle(parent,label,default,callback)
  100. local frame = new("Frame",{Size=UDim2.new(1,0,0,36),BackgroundTransparency=1})
  101. local lbl = makeLabel(frame,label,UDim2.new(0.7,0,1,0))
  102. lbl.Position = UDim2.new(0,0,0,8)
  103. local box = new("Frame",{Size=UDim2.new(0,0,0,24),Position=UDim2.new(1,-34,0,6),BackgroundColor3=Defaults.Card,BorderSizePixel=0})
  104. makeUICorner(box,UDim.new(0,14))
  105. box.Parent = frame
  106. local dot = new("Frame",{Size=UDim2.new(0,0,0,18),Position=UDim2.new(0,3,0,3),BackgroundColor3=Defaults.Background,BorderSizePixel=0})
  107. makeUICorner(dot,UDim.new(0,10))
  108. dot.Parent = box
  109. local toggled = default or false
  110. local function refresh()
  111. if toggled then
  112. tween(box,{Size=UDim2.new(0,50,0,24)},0.18)
  113. tween(dot,{Position=UDim2.new(1,-21,0,3)},0.18)
  114. createGradient(box)
  115. else
  116. tween(box,{Size=UDim2.new(0,34,0,24)},0.18)
  117. tween(dot,{Position=UDim2.new(0,3,0,3)},0.18)
  118. for _,v in pairs(box:GetChildren()) do if v:IsA("UIGradient") then v:Destroy() end end
  119. end
  120. end
  121. frame.InputBegan:Connect(function(input)
  122. if input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch then
  123. toggled = not toggled
  124. refresh()
  125. pcall(callback,toggled)
  126. end
  127. end)
  128. refresh()
  129. frame.Parent = parent
  130. return frame
  131. end
  132. local function createSlider(parent,label,min,max,default,callback)
  133. local frame = new("Frame",{Size=UDim2.new(1,0,0,48),BackgroundTransparency=1})
  134. local lbl = makeLabel(frame,label,UDim2.new(1,0,0,18))
  135. lbl.Position = UDim2.new(0,0,0,0)
  136. local bar = new("Frame",{Size=UDim2.new(1,0,0,12),Position=UDim2.new(0,0,0,28),BackgroundColor3=Color3.fromRGB(40,40,40),BorderSizePixel=0})
  137. makeUICorner(bar,UDim.new(0,6))
  138. bar.Parent = frame
  139. local fill = new("Frame",{Size=UDim2.new(0,0,0,12),BackgroundColor3=Defaults.Card,BorderSizePixel=0})
  140. makeUICorner(fill,UDim.new(0,6))
  141. fill.Parent = bar
  142. createGradient(fill)
  143. local handle = new("ImageLabel",{Size=UDim2.new(0,0,0,18),Position=UDim2.new(0,0,0,-3),BackgroundColor3=Defaults.Card,BorderSizePixel=0,Image=""})
  144. makeUICorner(handle,UDim.new(0,20))
  145. handle.Parent = bar
  146. local dragging = false
  147. local function setFromX(x)
  148. local rel = math.clamp((x - bar.AbsolutePosition.X)/bar.AbsoluteSize.X,0,1)
  149. local val = min + (max-min) * rel
  150. fill.Size = UDim2.new(rel,0,1,0)
  151. handle.Position = UDim2.new(rel,0,0,-3)
  152. pcall(callback,math.floor(val*100)/100)
  153. end
  154. handle.InputBegan:Connect(function(input)
  155. if input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch then
  156. dragging = true
  157. end
  158. end)
  159. handle.InputEnded:Connect(function(input)
  160. if input.UserInputState==Enum.UserInputState.End then dragging = false end
  161. end)
  162. game:GetService("UserInputService").InputChanged:Connect(function(input)
  163. if dragging and (input.UserInputType==Enum.UserInputType.MouseMovement or input.UserInputType==Enum.UserInputType.Touch) then
  164. setFromX(input.Position.X)
  165. end
  166. end)
  167. bar.InputBegan:Connect(function(input)
  168. if input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch then
  169. setFromX(input.Position.X)
  170. end
  171. end)
  172. frame.Parent = parent
  173. if default then
  174. local rel = math.clamp((default-min)/(max-min),0,1)
  175. fill.Size = UDim2.new(rel,0,1,0)
  176. handle.Position = UDim2.new(rel,0,0,-3)
  177. end
  178. return frame
  179. end
  180. local function createTextBox(parent,placeholder,callback)
  181. local frame = new("Frame",{Size=UDim2.new(1,0,0,40),BackgroundTransparency=1})
  182. local box = new("TextBox",{Size=UDim2.new(1,0,0,36),BackgroundColor3=Defaults.Card,TextColor3=Defaults.Text,Text=placeholder,PlaceholderText=placeholder,ClearTextOnFocus=false,Font=Enum.Font.Gotham,TextSize=14,BorderSizePixel=0})
  183. makeUICorner(box)
  184. box.Parent = frame
  185. box.Focused:Connect(function()
  186. if box.Text == placeholder then box.Text = "" end
  187. end)
  188. box.FocusLost:Connect(function(enter)
  189. pcall(callback,box.Text,enter)
  190. end)
  191. frame.Parent = parent
  192. return frame, box
  193. end
  194. local function createDropdown(parent,label,options,callback)
  195. local frame = new("Frame",{Size=UDim2.new(1,0,0,36),BackgroundTransparency=1})
  196. local lbl = makeLabel(frame,label,UDim2.new(0.6,0,1,0))
  197. lbl.Position = UDim2.new(0,0,0,8)
  198. local box = new("TextButton",{Size=UDim2.new(1,0,0,36),BackgroundColor3=Defaults.Card,Text=options[1] or "Select",TextColor3=Defaults.Text,BorderSizePixel=0,TextXAlignment=Enum.TextXAlignment.Left,Font=Enum.Font.Gotham,TextSize=14})
  199. makeUICorner(box)
  200. box.Parent = frame
  201. local list = new("Frame",{Size=UDim2.new(1,0,0,0),Position=UDim2.new(0,0,0,36),BackgroundColor3=Defaults.Card,ClipsDescendants=true})
  202. makeUICorner(list)
  203. list.Parent = frame
  204. local layout = new("UIListLayout",{Padding=UDim.new(0,4),SortOrder=Enum.SortOrder.LayoutOrder})
  205. layout.Parent = list
  206. local open = false
  207. local function build()
  208. for i,opt in pairs(options) do
  209. local btn = new("TextButton",{Text=opt,Size=UDim2.new(1,0,0,32),BackgroundTransparency=1,TextColor3=Defaults.Text,Font=Enum.Font.Gotham,TextSize=14,BorderSizePixel=0})
  210. btn.Parent = list
  211. btn.MouseButton1Click:Connect(function()
  212. box.Text = opt
  213. open = false
  214. tween(list,{Size=UDim2.new(1,0,0,0)},0.18)
  215. pcall(callback,opt)
  216. wait(0.2)
  217. for _,v in pairs(list:GetChildren()) do if v:IsA("TextButton") then v:Destroy() end end
  218. end)
  219. end
  220. end
  221. box.MouseButton1Click:Connect(function()
  222. if open then
  223. tween(list,{Size=UDim2.new(1,0,0,0)},0.18)
  224. open = false
  225. wait(0.18)
  226. for _,v in pairs(list:GetChildren()) do if v:IsA("TextButton") then v:Destroy() end end
  227. else
  228. build()
  229. local h = math.clamp(#options * 36, 36, 180)
  230. tween(list,{Size=UDim2.new(1,0,0,h)},0.18)
  231. open = true
  232. end
  233. end)
  234. frame.Parent = parent
  235. return frame
  236. end
  237. local function notify(title,msg,timeout)
  238. local gui = PlayerGui:FindFirstChild("MartinUI_Notifications") or new("ScreenGui",{Name="MartinUI_Notifications",Parent=PlayerGui,ResetOnSpawn=false})
  239. local container = gui:FindFirstChild("Container") or new("Frame",{Name="Container",Size=UDim2.new(0,300,0,0),Position=UDim2.new(1,-320,0,0),BackgroundTransparency=1,Parent=gui})
  240. container.ClipsDescendants = true
  241. container.Parent = gui
  242. local card = new("Frame",{Size=UDim2.new(1,0,0,72),BackgroundColor3=Defaults.Card,AnchorPoint=Vector2.new(1,0),Position=UDim2.new(1,0,0,0),BorderSizePixel=0})
  243. makeUICorner(card)
  244. card.Parent = container
  245. local titleLbl = new("TextLabel",{Text=title,Size=UDim2.new(1,0,0,20),Position=UDim2.new(0,8,0,8),BackgroundTransparency=1,TextColor3=Defaults.Text,Font=Enum.Font.GothamBold,TextSize=14,TextXAlignment=Enum.TextXAlignment.Left})
  246. titleLbl.Parent = card
  247. local msgLbl = new("TextLabel",{Text=msg,Size=UDim2.new(1,-16,0,36),Position=UDim2.new(0,8,0,28),BackgroundTransparency=1,TextColor3=Defaults.Text,Font=Enum.Font.Gotham,TextSize=13,TextWrapped=true,TextXAlignment=Enum.TextXAlignment.Left})
  248. msgLbl.Parent = card
  249. local h = container.Size.Y.Offset + 84
  250. tween(container,{Size=UDim2.new(0,300,0,h)},0.18)
  251. tween(card,{Position=UDim2.new(1,0,0,container.Size.Y.Offset)},0.28)
  252. spawn(function()
  253. wait(timeout or 4)
  254. tween(card,{Position=UDim2.new(1,0,0,container.Size.Y.Offset+84)},0.22)
  255. wait(0.22)
  256. tween(container,{Size=UDim2.new(0,300,0,container.Size.Y.Offset-84)},0.18)
  257. wait(0.18)
  258. card:Destroy()
  259. end)
  260. end
  261. function UI:CreateWindow(title,options)
  262. local opts = options or {}
  263. local screen = new("ScreenGui",{Name = "MartinUI_Main"..title,Parent = PlayerGui,ResetOnSpawn=false})
  264. local main = new("Frame",{Size = UDim2.new(0,640,0,420),Position = UDim2.new(0.5,-320,0.5,-210),AnchorPoint = Vector2.new(0.5,0.5),BackgroundColor3 = Defaults.Background,BorderSizePixel=0})
  265. makeUICorner(main,UDim.new(0,12))
  266. main.Parent = screen
  267. local shadow = makeShadow(main)
  268. local left = new("Frame",{Size=UDim2.new(0,160,1,0),Position=UDim2.new(0,0,0,0),BackgroundColor3=Color3.fromRGB(14,14,14),BorderSizePixel=0,Parent=main})
  269. makeUICorner(left)
  270. local right = new("Frame",{Size=UDim2.new(1,0,1,0),Position=UDim2.new(0,160,0,0),BackgroundTransparency=1,Parent=main})
  271. local header = new("Frame",{Size=UDim2.new(1,0,0,44),Position=UDim2.new(0,0,0,0),BackgroundTransparency=1,Parent=right})
  272. local titleLbl = new("TextLabel",{Text=title,Size=UDim2.new(1,0,0,36),Position=UDim2.new(0,12,0,4),BackgroundTransparency=1,TextColor3=Defaults.Text,Font=Enum.Font.GothamBold,TextSize=18,TextXAlignment=Enum.TextXAlignment.Left})
  273. titleLbl.Parent = header
  274. local topButtons = new("Frame",{Size=UDim2.new(0.3,0,1,0),Position=UDim2.new(0.7,0,0,0),BackgroundTransparency=1,Parent=header})
  275. local closeBtn = new("TextButton",{Text="✕",Size=UDim2.new(0,36,0,36),Position=UDim2.new(1,-44,0,4),BackgroundTransparency=0,BackgroundColor3=Defaults.Card,Font=Enum.Font.GothamBold,TextColor3=Defaults.Text,BorderSizePixel=0})
  276. makeUICorner(closeBtn,UDim.new(0,10))
  277. closeBtn.Parent = header
  278. closeBtn.MouseButton1Click:Connect(function()
  279. tween(main,{Size=UDim2.new(0,0,0,0),Position=UDim2.new(0.5,0,0.5,0)},0.28)
  280. wait(0.28)
  281. screen:Destroy()
  282. end)
  283. local sidebarLayout = new("UIListLayout",{Padding=UDim.new(0,8),SortOrder=Enum.SortOrder.LayoutOrder,Parent=left})
  284. sidebarLayout.Padding = UDim.new(0,12)
  285. local profile = new("Frame",{Size=UDim2.new(1,0,0,96),BackgroundTransparency=1,Parent=left})
  286. local avatar = new("ImageLabel",{Size=UDim2.new(0,64,0,64),Position=UDim2.new(0.5,-32,0,12),BackgroundColor3=Defaults.Card,BorderSizePixel=0})
  287. makeUICorner(avatar,UDim.new(0,16))
  288. avatar.Parent = profile
  289. local nameLbl = new("TextLabel",{Text=LocalPlayer.Name,Size=UDim2.new(1,0,0,20),Position=UDim2.new(0,0,0,76),BackgroundTransparency=1,TextColor3=Defaults.Text,Font=Enum.Font.GothamBold,TextSize=14,TextXAlignment=Enum.TextXAlignment.Center})
  290. nameLbl.Parent = profile
  291. local tabsContainer = new("Frame",{Size=UDim2.new(1,0,0,180),BackgroundTransparency=1,Parent=left})
  292. local tabsLayout = new("UIListLayout",{Padding=UDim.new(0,6),SortOrder=Enum.SortOrder.LayoutOrder,Parent=tabsContainer})
  293. local pagesParent = new("Frame",{Size=UDim2.new(1,0,1, -44),Position=UDim2.new(0,0,0,44),BackgroundTransparency=1,Parent=right})
  294. pagesParent.ClipsDescendants = true
  295. local pages = {}
  296. local currentPage = nil
  297. local function createTab(name)
  298. local btn = new("TextButton",{Text=name,Size=UDim2.new(1,0,0,36),BackgroundTransparency=1,TextColor3=Defaults.Text,Font=Enum.Font.Gotham,TextSize=14,BorderSizePixel=0})
  299. btn.Parent = tabsContainer
  300. local page = new("Frame",{Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,Visible=false,Parent=pagesParent})
  301. local layout = new("UIPadding",{PaddingTop=UDim.new(0,8),Parent=page})
  302. page.LayoutOrder = #pages + 1
  303. pages[name] = {Page = page, Button = btn}
  304. btn.MouseButton1Click:Connect(function()
  305. if currentPage and currentPage ~= page then currentPage.Visible = false end
  306. page.Visible = true
  307. currentPage = page
  308. end)
  309. return pages[name]
  310. end
  311. addDrag(main,header)
  312. main.Parent = screen
  313. local window = {
  314. Screen = screen,
  315. Main = main,
  316. CreateTab = function(self,name)
  317. local t = createTab(name)
  318. local tabAPI = {}
  319. function tabAPI:CreateButton(text,fn)
  320. local section = new("Frame",{Size=UDim2.new(1,0,0,44),BackgroundTransparency=1})
  321. section.Parent = t.Page
  322. makeButton(section,text,fn)
  323. return section
  324. end
  325. function tabAPI:CreateToggle(text,def,fn)
  326. return createToggle(t.Page,text,def,fn)
  327. end
  328. function tabAPI:CreateSlider(text,min,max,def,fn)
  329. return createSlider(t.Page,text,min,max,def,fn)
  330. end
  331. function tabAPI:CreateTextBox(placeholder,fn)
  332. return createTextBox(t.Page,placeholder,fn)
  333. end
  334. function tabAPI:CreateDropdown(text,options,fn)
  335. return createDropdown(t.Page,text,options,fn)
  336. end
  337. function tabAPI:CreateLabel(text)
  338. local l = makeLabel(t.Page,text,UDim2.new(1,0,0,20))
  339. return l
  340. end
  341. return tabAPI
  342. end,
  343. Notify = function(self,title,msg,timeout) notify(title,msg,timeout) end,
  344. Open = function(self)
  345. main.Size = UDim2.new(0,0,0,0)
  346. main.Position = UDim2.new(0.5,0,0.5,0)
  347. tween(main,{Size=UDim2.new(0,640,0,420),Position=UDim2.new(0.5,-320,0.5,-210)},0.28,Enum.EasingStyle.Cubic)
  348. end,
  349. Close = function(self)
  350. tween(main,{Size=UDim2.new(0,0,0,0),Position=UDim2.new(0.5,0,0.5,0)},0.28)
  351. wait(0.28)
  352. if screen then screen:Destroy() end
  353. end
  354. }
  355. table.insert(UI._windows,window)
  356. return window
  357. end
  358. return UI
  359.  
Advertisement
Add Comment
Please, Sign In to add comment