Advertisement
Guest User

fe

a guest
Oct 19th, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.83 KB | None | 0 0
  1.  
  2. local options = {
  3. rainbow = false,
  4. stripescolor = Color3.fromRGB(35, 35, 35),
  5. topcolor = Color3.fromRGB(35, 35, 35),
  6. textcolor = Color3.fromRGB(255, 255, 255),
  7. slidercolor = Color3.fromRGB(255, 150, 0),
  8. underlinecolor = Color3.fromRGB(250, 150, 0),
  9. animatedbackground = true,
  10. togglekey = Enum.KeyCode.RightShift,
  11. sliderbackground = true,
  12. titlefont = Enum.Font.GothamBlack,
  13. font = Enum.Font.SciFi,
  14. }
  15.  
  16.  
  17.  
  18. local library = {}
  19. local tabs = {}
  20.  
  21. local TweenService = game:GetService("TweenService")
  22. local ws = game:GetService("Workspace")
  23. local uis = game:GetService("UserInputService")
  24. local rs = game:GetService("RunService")
  25.  
  26. local Design1 = Instance.new("ScreenGui")
  27.  
  28. Design1.Name = "Design1"
  29. Design1.Parent = game.Players.LocalPlayer.PlayerGui
  30.  
  31. local function GetWindowSize ()
  32. local ws = game:GetService("Workspace")
  33. local X = ws.Camera.ViewportSize.X
  34. local Y = ws.Camera.ViewportSize.Y
  35. return {["X"] = X, ["Y"] = Y}
  36. end
  37.  
  38. local uiengineinternals = {okhand = false, isreset = false, uiuwu = {
  39. howmuchtoincrease = 0.50,
  40. thecheck = math.floor(GetWindowSize().X / 300) - 1
  41. }}
  42.  
  43. local oldPositions = {}
  44. local isopen = true
  45. local canaction = false
  46.  
  47. local function Resize (part,new,_delay)
  48. _delay = _delay or 0.5
  49. local tweenInfo = TweenInfo.new(_delay, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  50. local tween = TweenService:Create(part, tweenInfo, new)
  51. tween:Play()
  52. end
  53.  
  54. uis.InputBegan:connect(function(inputobj)
  55. if inputobj.KeyCode == options.togglekey then
  56. if not canaction then
  57. return
  58. end
  59. if isopen then
  60. canaction = false
  61. for index,tab in next, tabs do
  62. oldPositions[index] = tab.Position
  63. Resize(tab,{Position = UDim2.new(-1, 0, -1, 0)})
  64. end
  65. spawn(function() wait(0.5) canaction = true end)
  66. else
  67. canaction = false
  68. for index,tab in next, tabs do
  69. Resize(tab,{Position = oldPositions[index]})
  70. end
  71. spawn(function() wait(0.5) canaction = true end)
  72. end
  73. isopen = not isopen
  74. end
  75. end)
  76.  
  77. local function CreateDrag (gui)
  78. local UserInputService = game:GetService("UserInputService")
  79. local dragging
  80. local dragInput
  81. local dragStart
  82. local startPos
  83.  
  84. local function update(input)
  85. local delta = input.Position - dragStart
  86. Resize(gui, {Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)}, 0.16)
  87. end
  88.  
  89. gui.InputBegan:Connect(function(input)
  90. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  91. dragging = true
  92. dragStart = input.Position
  93. startPos = gui.Position
  94.  
  95. input.Changed:Connect(function()
  96. if input.UserInputState == Enum.UserInputState.End then
  97. dragging = false
  98. end
  99. end)
  100. end
  101. end)
  102.  
  103. gui.InputChanged:Connect(function(input)
  104. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  105. dragInput = input
  106. end
  107. end)
  108.  
  109. UserInputService.InputChanged:Connect(function(input)
  110. if input == dragInput and dragging then
  111. update(input)
  112. end
  113. end)
  114. end
  115.  
  116. local function CreateLiquidBar (hue, brightness, transparency, contrastlevel, speed, rpart)
  117. local Fragments = {}
  118. local length = rpart.AbsoluteSize.X
  119. local height = rpart.AbsoluteSize.Y
  120.  
  121. local function ColorFragment (n,c)
  122. local p = Fragments[n]
  123. p.BackgroundColor3 = c
  124. end
  125.  
  126. local WindowSize = GetWindowSize()
  127. local len = tonumber(tostring(rpart.Size.X):match("%d%p (%d+)"))
  128. for i = 1, length do
  129. Fragment = Instance.new("Frame", rpart)
  130. Fragment.BorderSizePixel = 0
  131. Fragment.Size = UDim2.new(0, 1, 0, height)
  132. Fragment.Position = UDim2.new((i - 1) / len, 0, 0, 0)
  133. Fragment.Transparency = transparency
  134. Fragment.ZIndex = rpart.ZIndex
  135.  
  136. table.insert(Fragments, Fragment)
  137.  
  138. local seth = hue + i / contrastlevel
  139. local setcolor = Color3.fromHSV(seth / 255 % 1, 1, brightness)
  140. ColorFragment(i, setcolor)
  141. end
  142.  
  143. local function Set (howmuch)
  144. for i = 1, length do
  145. local newh = hue + howmuch + i / contrastlevel
  146. local newcolor = Color3.fromHSV(newh / 255 % 1, 1, brightness)
  147. ColorFragment(i, newcolor)
  148. end
  149. end
  150.  
  151. local function Rotate ()
  152. for i = 255, 1, -1 do
  153. Set(i)
  154. wait(speed)
  155. end
  156. Set(0)
  157. end
  158.  
  159. spawn(Rotate)
  160.  
  161. spawn(function()
  162. while wait() do
  163. Rotate()
  164. end
  165. end)
  166. end
  167.  
  168. local function CreateTop (text)
  169. text = text or "New tab"
  170. local part = Instance.new("Frame", Design1)
  171.  
  172. local maxtabs = GetWindowSize().X / 300
  173.  
  174. if #tabs > uiengineinternals.uiuwu.thecheck and not uiengineinternals["okhand"] then
  175. uiengineinternals["isreset"] = true
  176. end
  177.  
  178. if uiengineinternals["isreset"] then
  179. part.Position = UDim2.new(0, 100, #tabs > uiengineinternals.uiuwu.thecheck and uiengineinternals.uiuwu.howmuchtoincrease or 0, 50)
  180. uiengineinternals["isreset"] = false
  181. uiengineinternals["okhand"] = true
  182. else
  183. part.Position = UDim2.new(0, #tabs == 0 and 100 or tabs[#tabs].Position.X.Offset + 300, #tabs > uiengineinternals.uiuwu.thecheck and uiengineinternals.uiuwu.howmuchtoincrease or 0, 50)
  184. end
  185.  
  186. part.Size = UDim2.new(0, 250, 0, 25)
  187.  
  188. part.BorderSizePixel = 4
  189. part.BorderColor3 = Color3.fromRGB(40, 40, 40)
  190. part.BackgroundColor3 = options.topcolor
  191. part.Draggable = true
  192. part.ZIndex = 3
  193.  
  194. if options.rainbow then
  195. CreateLiquidBar(0, 0.8, 0, 10, 0.05, part)
  196. end
  197.  
  198. local label = Instance.new("TextLabel", part)
  199. label.Size = part.Size
  200. label.BackgroundTransparency = 1
  201. label.TextSize = 19
  202. label.TextStrokeColor3 = Color3.new(0, 0, 0)
  203. label.TextStrokeTransparency = 0
  204. label.TextXAlignment = Enum.TextXAlignment.Right
  205. label.Font = options.titlefont
  206. label.TextColor3 = options.textcolor
  207. label.ZIndex = part.ZIndex
  208. label.Text = tostring(text) .. " "
  209. CreateDrag(part)
  210. table.insert(tabs, part)
  211.  
  212. local underline = Instance.new("Frame", part)
  213. underline.BackgroundColor3 = options.underlinecolor
  214. underline.BorderSizePixel = 0
  215. underline.Size = UDim2.new(0, 258, 0, 4)
  216. underline.Position = UDim2.new(0.5, -129, 1.2, -4)
  217. underline.ZIndex = part.ZIndex
  218.  
  219. return part
  220. end
  221.  
  222. function library:CreateTab (name)
  223. local elements = {}
  224. local parts = {}
  225.  
  226. local pixelspacing = 32
  227.  
  228. local Top = CreateTop(name)
  229. local body = Instance.new("Frame", Top)
  230.  
  231. body.Size = UDim2.new(0, 250, 0, 0)
  232. body.Position = UDim2.new(0.5, -125, 6.5, -130)
  233. body.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  234. body.BorderSizePixel = 4
  235. body.BorderColor3 = Color3.fromRGB(40, 40, 40)
  236. body.ClipsDescendants = true
  237.  
  238. local bodyelements = Instance.new("Frame", body)
  239. bodyelements.ZIndex = 2
  240. bodyelements.Size = body.Size + UDim2.new(0, 0, 0, 1000)
  241. bodyelements.BackgroundTransparency = 1
  242.  
  243. local function CreateBackground (color)
  244. local background = Instance.new("Frame", body)
  245. local function CreateSection (pos)
  246. local section = Instance.new("ImageLabel", background)
  247.  
  248. section.BackgroundColor3 = Color3.new(1, 1, 1)
  249. section.Position = pos
  250. section.Size = UDim2.new(0, 200, 0, 200)
  251. section.BackgroundTransparency = 1
  252. section.Image = "https://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId=4000222087"
  253. section.ImageColor3 = color
  254. end
  255.  
  256. for x = 0, 2 do
  257. for i = 0, 5 do
  258. CreateSection(UDim2.new(0, 197 * x, 0, i * 200 - (i * 3)))
  259. end
  260. end
  261.  
  262. local function Rotate (speed)
  263. local oldpos = UDim2.new(0, 0, 0, 0)
  264. local newpos = UDim2.new(-1, 93, 0, 0)
  265. local tweenInfo = TweenInfo.new(speed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  266. local tween = TweenService:Create(background, tweenInfo, {Position = newpos})
  267.  
  268. tween:Play()
  269. wait(speed - 0.1)
  270. background.Position = oldpos
  271. end
  272.  
  273. spawn(function()
  274. while true do
  275. Rotate(10)
  276. end
  277. end)
  278. end
  279. if options.animatedbackground then
  280. CreateBackground(options.stripescolor)
  281. end
  282. local actionbutton = Instance.new("TextButton", Top)
  283. actionbutton.BackgroundTransparency = 1
  284. actionbutton.TextScaled = true
  285. actionbutton.TextColor3 = options.textcolor
  286. actionbutton.TextStrokeTransparency = 0
  287. actionbutton.TextStrokeColor3 = Color3.new(1, 1, 1)
  288. actionbutton.Size = UDim2.new(0, 25, 0, 25)
  289. actionbutton.Position = UDim2.new(0.02, 0, 0, 0)
  290. actionbutton.Text = "-"
  291. actionbutton.ZIndex = Top.ZIndex
  292.  
  293. local function Close ()
  294. Resize(body,{Size = UDim2.new(0, 250, 0, 0), Position = UDim2.new(0.5, -125, 6.5, -150)})
  295. actionbutton.Text = "+"
  296. Resize(actionbutton, {Rotation = 180}, 0.25)
  297. actionbutton.Rotation = 0
  298. end
  299.  
  300. local function Open ()
  301. Resize(body, {Size = UDim2.new(0, 250, 0, pixelspacing * #parts), Position = UDim2.new(0.5, -125, 6.5, -130)})
  302. actionbutton.Text = "-"
  303. Resize(actionbutton, {Rotation = -180}, 0.25)
  304. actionbutton.Rotation = 0
  305. end
  306.  
  307. local open = true
  308. actionbutton.MouseButton1Click:connect(function()
  309. open = not open
  310. func = open and Open or Close
  311. func()
  312. end)
  313.  
  314. function elements:AddButton (text, callback)
  315. text = text or "New button"
  316. callback = callback or function() end
  317.  
  318. local button = Instance.new("TextButton", bodyelements)
  319.  
  320. button.Size = UDim2.new(0, 240, 0, 30)
  321. button.Position = UDim2.new(0.02, 0, (pixelspacing / 1000) * #parts + 0.0025, 0)
  322. button.BackgroundTransparency = 1
  323. button.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  324. button.BorderSizePixel = 0
  325. button.TextColor3 = Color3.new(1, 1, 1)
  326. button.TextSize = 14
  327. button.TextXAlignment = Enum.TextXAlignment.Left
  328. button.Font = options.font
  329. button.Text = " " .. tostring(text)
  330. button.ZIndex = bodyelements.ZIndex
  331.  
  332. button.MouseButton1Click:connect(function()
  333. pcall(callback)
  334. end)
  335.  
  336. Resize(body, {Size = UDim2.new(0, 250, 0, pixelspacing * #parts + 35)})
  337.  
  338. table.insert(parts, button)
  339. end
  340.  
  341. function elements:AddSwitch (text, callback)
  342. local switchactions = {}
  343. text = text or "New switch"
  344. callback = callback or function() end
  345.  
  346. local switch = Instance.new("TextLabel", bodyelements)
  347. switch.Size = UDim2.new(0, 240, 0, 30)
  348. switch.Position = UDim2.new(0.02, 0, (pixelspacing / 1000) * #parts + 0.0025, 0)
  349. switch.BackgroundTransparency = 1
  350. switch.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  351. switch.BorderSizePixel = 0
  352. switch.TextColor3 = Color3.new(1, 1, 1)
  353. switch.TextSize = 14
  354. switch.TextXAlignment = Enum.TextXAlignment.Left
  355. switch.Font = options.font
  356. switch.Text = " " .. tostring(text)
  357. switch.ZIndex = bodyelements.ZIndex
  358.  
  359. local enabled = false
  360. local checkmark = Instance.new("TextButton", switch)
  361. checkmark.Size = UDim2.new(0, 20, 0, 20)
  362. checkmark.Position = UDim2.new(0.9, 0, 0.15, 0)
  363. checkmark.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  364. checkmark.BorderColor3 = Color3.fromRGB(45, 45, 45)
  365. checkmark.BorderSizePixel = 1
  366. checkmark.TextColor3 = Color3.new(1, 1, 1)
  367. checkmark.TextScaled = true
  368. checkmark.Text = ""
  369. checkmark.ZIndex = switch.ZIndex
  370. checkmark.AutoButtonColor = false
  371.  
  372. local function Trigger ()
  373. enabled = not enabled
  374. checkmark.Text = enabled and utf8.char(10003) or ""
  375. pcall(callback, enabled)
  376. end
  377.  
  378. checkmark.MouseButton1Click:connect(Trigger)
  379.  
  380. function switchactions:Set (state)
  381. enabled = state
  382. checkmark.Text = enabled and utf8.char(10003) or ""
  383. pcall(callback, enabled)
  384. end
  385.  
  386. Resize(body, {Size = UDim2.new(0, 250, 0, pixelspacing * #parts + 35)})
  387. table.insert(parts, switch)
  388.  
  389. return switchactions
  390. end
  391.  
  392. function elements:AddBox(placeholder, callback)
  393. placeholder = placeholder or "New Box"
  394. callback = callback or function() end
  395. local button = Instance.new("TextBox", bodyelements)
  396. button.Size = UDim2.new(0, 240, 0, 30)
  397. button.Position = UDim2.new(0.02, 0, (pixelspacing / 1000) * #parts + 0.0025, 0)
  398. button.BackgroundTransparency = 1
  399. button.BorderSizePixel = 0
  400. button.TextColor3 = Color3.fromRGB(255, 255, 255)
  401. button.TextSize = 14
  402. button.TextXAlignment = Enum.TextXAlignment.Center
  403. button.Font = options.font
  404. button.Text = ""
  405. button.PlaceholderText = placeholder
  406. button.ZIndex = bodyelements.ZIndex
  407. button.FocusLost:connect(function()
  408. pcall(callback, button.Text)
  409. button.Text = ""
  410. end)
  411. Resize(body, {Size = UDim2.new(0, 250, 0, pixelspacing * #parts + 35)})
  412. table.insert(parts, button)
  413. end
  414.  
  415. function elements:AddLabel(text)
  416. text = text or "New Label"
  417. local button = Instance.new("TextLabel", bodyelements)
  418. button.Size = UDim2.new(0, 240, 0, 30)
  419. button.Position = UDim2.new(0.02, 0, (pixelspacing / 1000) * #parts + 0.0025, 0)
  420. button.BackgroundTransparency = 1
  421. button.BorderSizePixel = 0
  422. button.TextColor3 = Color3.fromRGB(255, 255, 255)
  423. button.TextSize = 14
  424. button.TextXAlignment = Enum.TextXAlignment.Center
  425. button.Font = options.font
  426. button.Text = text
  427. button.ZIndex = bodyelements.ZIndex
  428. Resize(body, {Size = UDim2.new(0, 250, 0, pixelspacing * #parts + 35)})
  429. table.insert(parts, button)
  430. end
  431.  
  432. function elements:AddSlider (text, minvalue, maxvalue, callback)
  433. local slideractions = {}
  434. text = text or "New slider"
  435. minvalue = minvalue or 0
  436. maxvalue = maxvalue or 100
  437. callback = callback or function() end
  438.  
  439. local box = Instance.new("TextLabel", bodyelements)
  440. box.Size = UDim2.new(0, 240, 0, 30)
  441. box.Position = UDim2.new(0.02, 0, (pixelspacing / 1000) * #parts + 0.0025, 0)
  442. box.BackgroundTransparency = 1
  443. box.TextColor3 = options.textcolor
  444. box.TextSize = 14
  445. box.TextXAlignment = Enum.TextXAlignment.Left
  446. box.TextYAlignment = Enum.TextYAlignment.Top
  447. box.Font = options.font
  448. box.Text = " " .. tostring(text)
  449. box.ZIndex = bodyelements.ZIndex
  450.  
  451. local value = Instance.new("TextLabel", box)
  452. value.Size = UDim2.new(0, 40, 0, 30)
  453. value.Position = UDim2.new(0.75, 0, 0, 0)
  454. value.BackgroundTransparency = 1
  455. value.TextColor3 = options.textcolor
  456. value.Text = minvalue
  457. value.TextSize = 10
  458. value.ZIndex = box.ZIndex
  459. value.TextYAlignment = Enum.TextYAlignment.Top
  460.  
  461. local container = Instance.new("ImageLabel", box)
  462. container.BackgroundTransparency = 1
  463. container.Position = UDim2.new(0.06, 0, 0.6, 0)
  464. container.Size = UDim2.new(0, 200, 0, 5)
  465. container.Image = "rbxassetid://2851926732"
  466. container.ImageColor3 = Color3.fromRGB(100, 100, 100)
  467. container.ScaleType = Enum.ScaleType.Slice
  468. container.SliceCenter = Rect.new(12, 12, 12, 12)
  469. container.ZIndex = box.ZIndex
  470.  
  471. local containerindicator = Instance.new("ImageLabel", container)
  472. containerindicator.BackgroundTransparency = 1
  473. containerindicator.Size = UDim2.new(0, 0, 0, 5)
  474. containerindicator.Image = "rbxassetid://2851926732"
  475. containerindicator.ImageColor3 = options.slidercolor
  476. containerindicator.ScaleType = Enum.ScaleType.Slice
  477. containerindicator.SliceCenter = Rect.new(12, 12, 12, 12)
  478. containerindicator.ZIndex = container.ZIndex
  479.  
  480. local ball = Instance.new("TextButton", container)
  481. ball.BackgroundTransparency = 1
  482. ball.Size = UDim2.new(0, 10, 0, 10)
  483. ball.Position = UDim2.new(0, 0, 0, -2.5)
  484. ball.BackgroundTransparency = 1
  485. ball.ZIndex = container.ZIndex
  486. ball.Text = ""
  487.  
  488. local balltexture = Instance.new("ImageLabel", ball)
  489. balltexture.Size = UDim2.new(1, 0, 1, 0)
  490. balltexture.Image = "rbxassetid://2851926732"
  491. balltexture.ScaleType = Enum.ScaleType.Slice
  492. balltexture.SliceCenter = Rect.new(12, 12, 12, 12)
  493. balltexture.ZIndex = ball.ZIndex
  494. balltexture.BackgroundTransparency = 1
  495.  
  496. do
  497. local currentvalue = minvalue
  498.  
  499. local Dragging
  500. ball.MouseButton1Down:connect(function()
  501. Dragging = true
  502. end)
  503. uis.InputEnded:Connect(function(inputObject)
  504. if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then
  505. Dragging = false
  506. end
  507. end)
  508.  
  509. local originalpos = ball.Position
  510.  
  511. local function GetValue ()
  512. local maxval = container.AbsoluteSize.X
  513. local currentval = ball.Position.X.Offset
  514. return math.floor((currentval / maxval) * (maxvalue - minvalue) + minvalue)
  515. end
  516.  
  517. local function SetValue (x)
  518. local newposition = UDim2.new(
  519. UDim.new(
  520. 0,
  521. math.clamp(x, 0, container.AbsoluteSize.X)
  522. ),
  523. originalpos.Y
  524. )
  525. Resize(ball, {Position = newposition}, 0.14)
  526. if options.sliderbackground then
  527. local newsize = UDim2.new(
  528. UDim.new(
  529. 0,
  530. math.clamp(x, 0, container.AbsoluteSize.X)
  531. ), 0, 0
  532. ) + UDim2.new(0, 0, 0, 5)
  533. Resize(containerindicator, {Size = newsize}, 0.14)
  534. end
  535. value.Text = tostring(GetValue())
  536. end
  537.  
  538. uis.InputChanged:connect(function(InputObject, GameProcessedEvent)
  539. if ((not GameProcessedEvent) and Dragging) then
  540. if (InputObject.UserInputType == Enum.UserInputType.MouseMovement) then
  541. local set = InputObject.Position.X - container.AbsolutePosition.X
  542. SetValue(set)
  543. end
  544. end
  545. end)
  546.  
  547. value:GetPropertyChangedSignal("Text"):Connect(function()
  548. pcall(callback, GetValue())
  549. end)
  550.  
  551. function slideractions:Set (x)
  552. SetValue((x / (maxvalue - minvalue) + minvalue) / 200)
  553. end
  554. end
  555.  
  556. Resize(body, {Size = UDim2.new(0, 250, 0, pixelspacing * #parts + 35)})
  557. table.insert(parts, box)
  558. return slideractions
  559. end
  560.  
  561. spawn(function() wait(0.5) canaction = true end)
  562.  
  563. return elements
  564. end
  565.  
  566. local Example = library:CreateTab("Test")
  567.  
  568. local Label = Example:AddLabel("Test Label")
  569.  
  570. local Switch = Example:AddSwitch("Test Switch", function (state)
  571. warn("Toggled to : " .. tostring(state) .. "!")
  572. end)
  573.  
  574. Switch:Set(true)
  575.  
  576. local Button = Example:AddButton("Test Button", function ()
  577. print("Button pressed!")
  578. end)
  579.  
  580. local Box = Example:AddBox("Test Box", function (text)
  581. print("Box input : " .. text)
  582. end)
  583.  
  584. local Slider = Example:AddSlider("Test Slider", 1, 100, function (x)
  585. warn("Toggled to : " .. tostring(x) .. "!")
  586. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement