SHADOWCRAFTER666

OBJ5

Apr 28th, 2019
196
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- // Rainbow RGB Values \\ --
  2. local rainbow = {r=0,g=0,b=0}
  3. coroutine.resume(coroutine.create(function()
  4. local rainbowSpeed = 30
  5. while true do
  6. rainbow.r = 255
  7. for i = 1, rainbowSpeed do
  8. game:GetService("RunService").Stepped:Wait()
  9. rainbow.g = rainbow.g + 255/rainbowSpeed
  10. end
  11. for i = 1, rainbowSpeed do
  12. game:GetService("RunService").Stepped:Wait()
  13. rainbow.r = rainbow.r - 255/rainbowSpeed
  14. end
  15. for i = 1, rainbowSpeed do
  16. game:GetService("RunService").Stepped:Wait()
  17. rainbow.b = rainbow.b + 255/rainbowSpeed
  18. end
  19. for i = 1, rainbowSpeed do
  20. game:GetService("RunService").Stepped:Wait()
  21. rainbow.g = rainbow.g - 255/rainbowSpeed
  22. end
  23. for i = 1, rainbowSpeed do
  24. game:GetService("RunService").Stepped:Wait()
  25. rainbow.r = rainbow.r + 255/rainbowSpeed
  26. end
  27. for i = 1, rainbowSpeed do
  28. game:GetService("RunService").Stepped:Wait()
  29. rainbow.b = rainbow.b - 255/rainbowSpeed
  30. end
  31. end
  32. end))
  33.  
  34. local library = {
  35. ["windowcount"] = 0;
  36. ["windows"] = {};
  37. }
  38.  
  39. local windowDefaults = {
  40. ["barColor"] = Color3.fromRGB(40,40,40);
  41. ["textColor"] = Color3.fromRGB(255,255,255);
  42. ["bgColor"] = Color3.fromRGB(0,0,0);
  43. ["bgTransparency"] = 0.5;
  44.  
  45. ["name"] = "NewWindow";
  46. }
  47.  
  48. local guiDefaults = {
  49. ["name"] = "NewClient";
  50. ["version"] = "v1.0.0";
  51.  
  52. ["toggleButton"] = Enum.KeyCode.RightShift;
  53.  
  54. ["rainbowMode"] = true;
  55. ["studioMode"] = true;
  56. }
  57.  
  58. local guiOptions
  59.  
  60. -- // New Instance \\ --
  61. function library:Create(class, properties)
  62. -- // Creating Object \\ --
  63. local object = Instance.new(class)
  64. -- // Setting Properties \\ --
  65. for __,v in next, properties do
  66. if __ ~= "Parent" then
  67. object[__] = v
  68. end
  69. end
  70. -- // Setting Parent \\ --
  71. object.Parent = properties.Parent
  72. -- // Return Object \\ --
  73. return object
  74. end
  75.  
  76. -- // Use Toggle Button \\ --
  77. function library:UseToggle()
  78. -- // Variables and Stuff \\ --
  79. local toggleKey = guiOptions.toggleButton or guiDefaults.toggleButton
  80. local toggled = true
  81. local canToggle = true
  82. local toggleBlur = self:Create("BlurEffect", {
  83. Name = "ToggleBlurEffect";
  84. Parent = game:GetService("Lighting");
  85. Enabled = true;
  86. Size = 25;
  87. })
  88.  
  89. -- // Toggle Blur Precaution \\ --
  90. for __,v in pairs(game:GetService("Lighting"):GetChildren()) do
  91. if (v.Name == "ToggleBlurEffect") and (v:IsA("BlurEffect")) and (v ~= toggleBlur) then
  92. v:Destroy()
  93. end
  94. end
  95.  
  96. coroutine.resume(coroutine.create(function()
  97. game:GetService("UserInputService").InputBegan:Connect(function(input, b)
  98. if (input.KeyCode == toggleKey) and (canToggle == true) then
  99. -- // Toggle The Toggle \\ --
  100. toggled = not toggled
  101. -- // Disable Toggling \\ --
  102. canToggle = false
  103. if (toggled == true) then
  104. -- // Turn All Guis On \\ --
  105. coroutine.resume(coroutine.create(function()
  106. for __,v in pairs(library.windows) do
  107. v.bar.Visible = true
  108. end
  109. if (self.title) then
  110. self.title.Visible = true
  111. end
  112. end))
  113. -- // Show Blur \\ --
  114. coroutine.resume(coroutine.create(function()
  115. -- // Precautions \\ --
  116. toggleBlur.Size = 0
  117. -- // Adding Blur \\ --
  118. for i = 1, 35 do
  119. toggleBlur.Size = toggleBlur.Size + 25/35
  120. game:GetService("RunService").Stepped:Wait()
  121. end
  122. -- // Precautions \\ --
  123. toggleBlur.Size = 25
  124. -- // Enabled Toggling \\ --
  125. canToggle = true
  126. end))
  127. else
  128. -- // Turn All Guis Off \\ --
  129. coroutine.resume(coroutine.create(function()
  130. for __,v in pairs(library.windows) do
  131. v.bar.Visible = false
  132. end
  133. if (self.title) then
  134. self.title.Visible = false
  135. end
  136. end))
  137. -- // Remove Blur \\ --
  138. coroutine.resume(coroutine.create(function()
  139. -- // Precautions \\ --
  140. toggleBlur.Size = 25
  141. -- // Removing Blur \\ --
  142. for i = 1, 35 do
  143. toggleBlur.Size = toggleBlur.Size - 25/35
  144. game:GetService("RunService").Stepped:Wait()
  145. end
  146. -- // Precautions \\ --
  147. toggleBlur.Size = 0
  148. -- // Enabled Toggling \\ --
  149. canToggle = true
  150. end))
  151. end
  152. end
  153. end)
  154. end))
  155. end
  156.  
  157. -- // Set Options \\ --
  158. function library:SetOptions(options)
  159. -- // Overwriting Default Options \\ --
  160. guiOptions = options or {}
  161. setmetatable(guiOptions, {__index = guiDefaults})
  162. end
  163.  
  164. -- // Create New Window \\ --
  165. function library:NewWindow(options)
  166. -- // Window Table \\ --
  167. local window = {
  168. ["objectCount"] = 0;
  169. ["open"] = true;
  170. ["toggles"] = {};
  171. ["rainbowObjects"] = {};
  172. }
  173.  
  174. -- // Overwriting Default Options \\ --
  175. local windowOptions = options or {}
  176. setmetatable(windowOptions, {__index = windowDefaults})
  177.  
  178. -- // Window Created = One More Window \\ --
  179. self.windowcount = self.windowcount + 1
  180.  
  181. -- // Set Gui Options To Default If Does Not Exist \\ --
  182. if (not guiOptions) then
  183. guiOptions = {}
  184. setmetatable(guiOptions, {__index = guiDefaults})
  185. end
  186.  
  187. -- // Toggle Blur Precaution \\ --
  188. if (game:GetService("Lighting"):FindFirstChild("ToggleBlur")) then
  189. game:GetService("Lighting"):FindFirstChild("ToggleBlur"):Destroy()
  190. end
  191.  
  192. -- // Create ScreenGui If Not Already Created \\ --
  193. if (not library.gui) and (not library.title) then
  194. library.gui = self:Create("ScreenGui", {
  195. Name = "ExploitGuiLibrary",
  196. -- // Set Parent To PlayerGui If In Studio \\ --
  197. Parent = (guiOptions.studioMode and game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")) or (game:GetService("CoreGui"))
  198. })
  199.  
  200. -- // Gui Creation : Client Title \\ --
  201. library.title = self:Create("TextLabel", {
  202. Name = "ClientTitle";
  203. Parent = self.gui;
  204. BackgroundTransparency = 1;
  205. BorderSizePixel = 0;
  206. Position = UDim2.new(0,5,0,5);
  207. Size = UDim2.new(0,600,0,40);
  208. Font = Enum.Font.GothamBlack;
  209. Text = string.format("%s %s", guiOptions.name, guiOptions.version);
  210. TextColor3 = windowOptions.barColor;
  211. TextScaled = true;
  212. TextXAlignment = Enum.TextXAlignment.Left;
  213. ZIndex = 1;
  214. })
  215. end
  216.  
  217. -- // Gui Creation : Bar With Title And Toggle \\ --
  218. window.bar = self:Create("TextButton", {
  219. Name = "ControlBar";
  220. Parent = self.gui;
  221. Selectable = true;
  222. Active = true;
  223. AutoButtonColor = false;
  224. Draggable = true;
  225. BackgroundColor3 = windowOptions.barColor;
  226. BackgroundTransparency = 0;
  227. BorderSizePixel = 0;
  228. Size = UDim2.new(0,175,0,30);
  229. Position = UDim2.new(0,15 + (185*(self.windowcount-1)),0,65); -- Y Offset Reference || + (math.floor(self.windowcount/4) * 150)
  230. Font = Enum.Font.GothamBlack;
  231. Text = windowOptions.name;
  232. TextColor3 = windowOptions.textColor;
  233. TextSize = 17;
  234. ZIndex = 1;
  235. })
  236.  
  237. -- // Gui Creation : Background \\ --
  238. window.background = self:Create("Frame", {
  239. Name = "Background";
  240. Parent = window.bar;
  241. AnchorPoint = Vector2.new(0.5,0);
  242. BackgroundTransparency = windowOptions.bgTransparency;
  243. BorderSizePixel = 0;
  244. BackgroundColor3 = windowOptions.bgColor;
  245. Position = UDim2.new(0.5,0,1,0);
  246. Size = UDim2.new(0.95,0,0,25);
  247. ClipsDescendants = true;
  248. ZIndex = 1;
  249. })
  250.  
  251. -- // Window Methods : Rainbowify \\ --
  252. function window:Rainbowify(duration, obj, property)
  253. -- // Variable : Rainbow Is Active \\ --
  254. local rainbowActive = true
  255. -- // Variable : Original Color \\ --
  256. local origColor = obj[property or "BackgroundColor3"]
  257. -- // Add To Rainbow Objects Table \\ --
  258. self.rainbowObjects[obj] = true
  259. coroutine.resume(coroutine.create(function()
  260. -- // If There Is A Duration, After Duration, Turn Off. \\ --
  261. if (duration > 0) then
  262. wait(duration)
  263. rainbowActive = false
  264. end
  265. end))
  266. coroutine.resume(coroutine.create(function()
  267. -- // While Rainbow Is Active And Item Is In The Rainbow Objects Table \\ --
  268. while (rainbowActive == true) and (self.rainbowObjects[obj] ~= nil) do
  269. game:GetService("RunService").Stepped:Wait()
  270. -- // Change Color Of Property Input Or BackGroundColor3 \\ --
  271. obj[property or "BackgroundColor3"] = Color3.fromRGB(rainbow.r, rainbow.g, rainbow.b)
  272. end
  273. -- // Back To Original Color \\ --
  274. obj[property or "BackgroundColor3"] = origColor
  275. end))
  276. end
  277.  
  278. -- // Window Methods : Unrainbowify \\ --
  279. function window:Unrainbowify(obj)
  280. -- // Remove Object From Rainbow Table \\ --
  281. self.rainbowObjects[obj] = nil
  282. end
  283.  
  284. -- // Window Methods : Resize \\ --
  285. function window:Resize(tween, change)
  286. local size = change or UDim2.new(0.95,0,0,((20*self.objectCount)+10))
  287. if (tween == true) then
  288. self.background:TweenSize(size, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
  289. else
  290. self.background.Size = size
  291. end
  292. end
  293.  
  294. -- // Window Methods : Add Button \\ --
  295. function window:AddButton(text, callback, cooldown)
  296. -- // Another Object Was Created \\ --
  297. self.objectCount = self.objectCount + 1
  298.  
  299. -- // If There Is No Callback Function, Make One \\ --
  300. callback = callback or function()end
  301.  
  302. -- // Create The Button \\ --
  303. local button = library:Create("TextButton", {
  304. Text = string.format("> %s", tostring(text)) or "> New Button";
  305. Size = UDim2.new(1,-10,0,20);
  306. Position = UDim2.new(0,5,0,(20*(self.objectCount-1))+5);
  307. BackgroundTransparency = 1;
  308. BorderSizePixel = 0;
  309. TextColor3 = windowOptions.textColor;
  310. TextXAlignment = Enum.TextXAlignment.Left;
  311. TextSize = 16;
  312. Font = Enum.Font.SourceSansSemibold;
  313. Name = text;
  314. Parent = self.background;
  315. })
  316.  
  317. -- // Use Callback Function And Use Rainbowify, 0.35 Cooldown \\ --
  318. local canClick = true
  319. button.MouseButton1Click:Connect(function()
  320. if (canClick == true) then
  321. -- // Rainbowify \\ --
  322. if (guiOptions.rainbowMode == true) then
  323. coroutine.resume(coroutine.create(function()
  324. window:Rainbowify(cooldown or 0.35, button, "TextColor3")
  325. end))
  326. end
  327. -- // Callback \\ --
  328. callback()
  329. -- // Cooldown \\ --
  330. coroutine.resume(coroutine.create(function()
  331. canClick = false
  332. wait(cooldown or 0.35)
  333. canClick = true
  334. end))
  335. end
  336. end)
  337.  
  338. -- // Resize Window Instantly \\ --
  339. self:Resize()
  340.  
  341. -- // Return The Button For Use \\ --
  342. return button
  343. end
  344.  
  345. -- // Window Methods : Add Toggle Button \\ --
  346. function window:AddToggle(text, callback)
  347. -- // Another Object Was Created \\ --
  348. self.objectCount = self.objectCount + 1
  349.  
  350. -- // If There Is No Callback Function, Make One \\ --
  351. callback = callback or function()end
  352.  
  353. -- // Create The Toggle \\ --
  354. local toggle = library:Create("TextButton", {
  355. Text = string.format("> %s", tostring(text)) or "> New Toggle";
  356. Size = UDim2.new(1,-10,0,20);
  357. Position = UDim2.new(0,5,0,(20*(self.objectCount-1))+5);
  358. BackgroundTransparency = 1;
  359. BorderSizePixel = 0;
  360. TextColor3 = windowOptions.textColor;
  361. TextXAlignment = Enum.TextXAlignment.Left;
  362. TextSize = 16;
  363. Font = Enum.Font.SourceSansSemibold;
  364. Name = text;
  365. Parent = self.background;
  366. })
  367.  
  368. -- // Default Toggle Off \\ --
  369. self.toggles[toggle] = false
  370.  
  371. -- // Use Callback Function And Rainbowify If In Rainbow Mode \\ --
  372. toggle.MouseButton1Click:Connect(function()
  373. -- // Change Toggle \\ --
  374. self.toggles[toggle] = not self.toggles[toggle]
  375. -- // Callback Function \\ --
  376. coroutine.resume(coroutine.create(function()
  377. callback(self.toggles[toggle])
  378. end))
  379. -- // Rainbowify and Unrainbowify \\ --
  380. coroutine.resume(coroutine.create(function()
  381. if (guiOptions.rainbowMode == true) then
  382. if (self.toggles[toggle] == true) then
  383. window:Rainbowify(-1, toggle, "TextColor3")
  384. else
  385. window:Unrainbowify(toggle)
  386. end
  387. end
  388. end))
  389. end)
  390.  
  391. -- // Resize Window Instantly \\ --
  392. self:Resize()
  393.  
  394. -- // Return The Toggle For Use \\ --
  395. return toggle
  396. end
  397.  
  398. -- // Gui Functions : Toggle Gui \\ --
  399. coroutine.resume(coroutine.create(function()
  400. window.bar.MouseButton2Click:Connect(function()
  401. window.open = not window.open
  402. if (window.open == true) then
  403. window:Resize(true)
  404. else
  405. window:Resize(true, UDim2.new(0.95,0,0,0))
  406. end
  407. end)
  408. end))
  409.  
  410. -- // Gui Extras : Rainbow Mode \\ --
  411. if (guiOptions.rainbowMode == true) then
  412. window:Rainbowify(-1, window.bar)
  413. window:Rainbowify(-1, self.title, "TextColor3")
  414. end
  415.  
  416. -- // Add Window To Library \\ --
  417. table.insert(library.windows, window)
  418.  
  419. -- // Return The Window For Usage \\ --
  420. return window
  421. end
  422.  
  423. return library
RAW Paste Data