Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- // Rainbow RGB Values \\ --
- local rainbow = {r=0,g=0,b=0}
- coroutine.resume(coroutine.create(function()
- local rainbowSpeed = 30
- while true do
- rainbow.r = 255
- for i = 1, rainbowSpeed do
- game:GetService("RunService").Stepped:Wait()
- rainbow.g = rainbow.g + 255/rainbowSpeed
- end
- for i = 1, rainbowSpeed do
- game:GetService("RunService").Stepped:Wait()
- rainbow.r = rainbow.r - 255/rainbowSpeed
- end
- for i = 1, rainbowSpeed do
- game:GetService("RunService").Stepped:Wait()
- rainbow.b = rainbow.b + 255/rainbowSpeed
- end
- for i = 1, rainbowSpeed do
- game:GetService("RunService").Stepped:Wait()
- rainbow.g = rainbow.g - 255/rainbowSpeed
- end
- for i = 1, rainbowSpeed do
- game:GetService("RunService").Stepped:Wait()
- rainbow.r = rainbow.r + 255/rainbowSpeed
- end
- for i = 1, rainbowSpeed do
- game:GetService("RunService").Stepped:Wait()
- rainbow.b = rainbow.b - 255/rainbowSpeed
- end
- end
- end))
- local library = {
- ["windowcount"] = 0;
- ["windows"] = {};
- }
- local windowDefaults = {
- ["barColor"] = Color3.fromRGB(40,40,40);
- ["textColor"] = Color3.fromRGB(255,255,255);
- ["bgColor"] = Color3.fromRGB(0,0,0);
- ["bgTransparency"] = 0.5;
- ["name"] = "NewWindow";
- }
- local guiDefaults = {
- ["name"] = "NewClient";
- ["version"] = "v1.0.0";
- ["toggleButton"] = Enum.KeyCode.RightShift;
- ["rainbowMode"] = true;
- ["studioMode"] = true;
- }
- local guiOptions
- -- // New Instance \\ --
- function library:Create(class, properties)
- -- // Creating Object \\ --
- local object = Instance.new(class)
- -- // Setting Properties \\ --
- for __,v in next, properties do
- if __ ~= "Parent" then
- object[__] = v
- end
- end
- -- // Setting Parent \\ --
- object.Parent = properties.Parent
- -- // Return Object \\ --
- return object
- end
- -- // Use Toggle Button \\ --
- function library:UseToggle()
- -- // Variables and Stuff \\ --
- local toggleKey = guiOptions.toggleButton or guiDefaults.toggleButton
- local toggled = true
- local canToggle = true
- local toggleBlur = self:Create("BlurEffect", {
- Name = "ToggleBlurEffect";
- Parent = game:GetService("Lighting");
- Enabled = true;
- Size = 25;
- })
- -- // Toggle Blur Precaution \\ --
- for __,v in pairs(game:GetService("Lighting"):GetChildren()) do
- if (v.Name == "ToggleBlurEffect") and (v:IsA("BlurEffect")) and (v ~= toggleBlur) then
- v:Destroy()
- end
- end
- coroutine.resume(coroutine.create(function()
- game:GetService("UserInputService").InputBegan:Connect(function(input, b)
- if (input.KeyCode == toggleKey) and (canToggle == true) then
- -- // Toggle The Toggle \\ --
- toggled = not toggled
- -- // Disable Toggling \\ --
- canToggle = false
- if (toggled == true) then
- -- // Turn All Guis On \\ --
- coroutine.resume(coroutine.create(function()
- for __,v in pairs(library.windows) do
- v.bar.Visible = true
- end
- if (self.title) then
- self.title.Visible = true
- end
- end))
- -- // Show Blur \\ --
- coroutine.resume(coroutine.create(function()
- -- // Precautions \\ --
- toggleBlur.Size = 0
- -- // Adding Blur \\ --
- for i = 1, 35 do
- toggleBlur.Size = toggleBlur.Size + 25/35
- game:GetService("RunService").Stepped:Wait()
- end
- -- // Precautions \\ --
- toggleBlur.Size = 25
- -- // Enabled Toggling \\ --
- canToggle = true
- end))
- else
- -- // Turn All Guis Off \\ --
- coroutine.resume(coroutine.create(function()
- for __,v in pairs(library.windows) do
- v.bar.Visible = false
- end
- if (self.title) then
- self.title.Visible = false
- end
- end))
- -- // Remove Blur \\ --
- coroutine.resume(coroutine.create(function()
- -- // Precautions \\ --
- toggleBlur.Size = 25
- -- // Removing Blur \\ --
- for i = 1, 35 do
- toggleBlur.Size = toggleBlur.Size - 25/35
- game:GetService("RunService").Stepped:Wait()
- end
- -- // Precautions \\ --
- toggleBlur.Size = 0
- -- // Enabled Toggling \\ --
- canToggle = true
- end))
- end
- end
- end)
- end))
- end
- -- // Set Options \\ --
- function library:SetOptions(options)
- -- // Overwriting Default Options \\ --
- guiOptions = options or {}
- setmetatable(guiOptions, {__index = guiDefaults})
- end
- -- // Create New Window \\ --
- function library:NewWindow(options)
- -- // Window Table \\ --
- local window = {
- ["objectCount"] = 0;
- ["open"] = true;
- ["toggles"] = {};
- ["rainbowObjects"] = {};
- }
- -- // Overwriting Default Options \\ --
- local windowOptions = options or {}
- setmetatable(windowOptions, {__index = windowDefaults})
- -- // Window Created = One More Window \\ --
- self.windowcount = self.windowcount + 1
- -- // Set Gui Options To Default If Does Not Exist \\ --
- if (not guiOptions) then
- guiOptions = {}
- setmetatable(guiOptions, {__index = guiDefaults})
- end
- -- // Toggle Blur Precaution \\ --
- if (game:GetService("Lighting"):FindFirstChild("ToggleBlur")) then
- game:GetService("Lighting"):FindFirstChild("ToggleBlur"):Destroy()
- end
- -- // Create ScreenGui If Not Already Created \\ --
- if (not library.gui) and (not library.title) then
- library.gui = self:Create("ScreenGui", {
- Name = "ExploitGuiLibrary",
- -- // Set Parent To PlayerGui If In Studio \\ --
- Parent = (guiOptions.studioMode and game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")) or (game:GetService("CoreGui"))
- })
- -- // Gui Creation : Client Title \\ --
- library.title = self:Create("TextLabel", {
- Name = "ClientTitle";
- Parent = self.gui;
- BackgroundTransparency = 1;
- BorderSizePixel = 0;
- Position = UDim2.new(0,5,0,5);
- Size = UDim2.new(0,600,0,40);
- Font = Enum.Font.GothamBlack;
- Text = string.format("%s %s", guiOptions.name, guiOptions.version);
- TextColor3 = windowOptions.barColor;
- TextScaled = true;
- TextXAlignment = Enum.TextXAlignment.Left;
- ZIndex = 1;
- })
- end
- -- // Gui Creation : Bar With Title And Toggle \\ --
- window.bar = self:Create("TextButton", {
- Name = "ControlBar";
- Parent = self.gui;
- Selectable = true;
- Active = true;
- AutoButtonColor = false;
- Draggable = true;
- BackgroundColor3 = windowOptions.barColor;
- BackgroundTransparency = 0;
- BorderSizePixel = 0;
- Size = UDim2.new(0,175,0,30);
- Position = UDim2.new(0,15 + (185*(self.windowcount-1)),0,65); -- Y Offset Reference || + (math.floor(self.windowcount/4) * 150)
- Font = Enum.Font.GothamBlack;
- Text = windowOptions.name;
- TextColor3 = windowOptions.textColor;
- TextSize = 17;
- ZIndex = 1;
- })
- -- // Gui Creation : Background \\ --
- window.background = self:Create("Frame", {
- Name = "Background";
- Parent = window.bar;
- AnchorPoint = Vector2.new(0.5,0);
- BackgroundTransparency = windowOptions.bgTransparency;
- BorderSizePixel = 0;
- BackgroundColor3 = windowOptions.bgColor;
- Position = UDim2.new(0.5,0,1,0);
- Size = UDim2.new(0.95,0,0,25);
- ClipsDescendants = true;
- ZIndex = 1;
- })
- -- // Window Methods : Rainbowify \\ --
- function window:Rainbowify(duration, obj, property)
- -- // Variable : Rainbow Is Active \\ --
- local rainbowActive = true
- -- // Variable : Original Color \\ --
- local origColor = obj[property or "BackgroundColor3"]
- -- // Add To Rainbow Objects Table \\ --
- self.rainbowObjects[obj] = true
- coroutine.resume(coroutine.create(function()
- -- // If There Is A Duration, After Duration, Turn Off. \\ --
- if (duration > 0) then
- wait(duration)
- rainbowActive = false
- end
- end))
- coroutine.resume(coroutine.create(function()
- -- // While Rainbow Is Active And Item Is In The Rainbow Objects Table \\ --
- while (rainbowActive == true) and (self.rainbowObjects[obj] ~= nil) do
- game:GetService("RunService").Stepped:Wait()
- -- // Change Color Of Property Input Or BackGroundColor3 \\ --
- obj[property or "BackgroundColor3"] = Color3.fromRGB(rainbow.r, rainbow.g, rainbow.b)
- end
- -- // Back To Original Color \\ --
- obj[property or "BackgroundColor3"] = origColor
- end))
- end
- -- // Window Methods : Unrainbowify \\ --
- function window:Unrainbowify(obj)
- -- // Remove Object From Rainbow Table \\ --
- self.rainbowObjects[obj] = nil
- end
- -- // Window Methods : Resize \\ --
- function window:Resize(tween, change)
- local size = change or UDim2.new(0.95,0,0,((20*self.objectCount)+10))
- if (tween == true) then
- self.background:TweenSize(size, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
- else
- self.background.Size = size
- end
- end
- -- // Window Methods : Add Button \\ --
- function window:AddButton(text, callback, cooldown)
- -- // Another Object Was Created \\ --
- self.objectCount = self.objectCount + 1
- -- // If There Is No Callback Function, Make One \\ --
- callback = callback or function()end
- -- // Create The Button \\ --
- local button = library:Create("TextButton", {
- Text = string.format("> %s", tostring(text)) or "> New Button";
- Size = UDim2.new(1,-10,0,20);
- Position = UDim2.new(0,5,0,(20*(self.objectCount-1))+5);
- BackgroundTransparency = 1;
- BorderSizePixel = 0;
- TextColor3 = windowOptions.textColor;
- TextXAlignment = Enum.TextXAlignment.Left;
- TextSize = 16;
- Font = Enum.Font.SourceSansSemibold;
- Name = text;
- Parent = self.background;
- })
- -- // Use Callback Function And Use Rainbowify, 0.35 Cooldown \\ --
- local canClick = true
- button.MouseButton1Click:Connect(function()
- if (canClick == true) then
- -- // Rainbowify \\ --
- if (guiOptions.rainbowMode == true) then
- coroutine.resume(coroutine.create(function()
- window:Rainbowify(cooldown or 0.35, button, "TextColor3")
- end))
- end
- -- // Callback \\ --
- callback()
- -- // Cooldown \\ --
- coroutine.resume(coroutine.create(function()
- canClick = false
- wait(cooldown or 0.35)
- canClick = true
- end))
- end
- end)
- -- // Resize Window Instantly \\ --
- self:Resize()
- -- // Return The Button For Use \\ --
- return button
- end
- -- // Window Methods : Add Toggle Button \\ --
- function window:AddToggle(text, callback)
- -- // Another Object Was Created \\ --
- self.objectCount = self.objectCount + 1
- -- // If There Is No Callback Function, Make One \\ --
- callback = callback or function()end
- -- // Create The Toggle \\ --
- local toggle = library:Create("TextButton", {
- Text = string.format("> %s", tostring(text)) or "> New Toggle";
- Size = UDim2.new(1,-10,0,20);
- Position = UDim2.new(0,5,0,(20*(self.objectCount-1))+5);
- BackgroundTransparency = 1;
- BorderSizePixel = 0;
- TextColor3 = windowOptions.textColor;
- TextXAlignment = Enum.TextXAlignment.Left;
- TextSize = 16;
- Font = Enum.Font.SourceSansSemibold;
- Name = text;
- Parent = self.background;
- })
- -- // Default Toggle Off \\ --
- self.toggles[toggle] = false
- -- // Use Callback Function And Rainbowify If In Rainbow Mode \\ --
- toggle.MouseButton1Click:Connect(function()
- -- // Change Toggle \\ --
- self.toggles[toggle] = not self.toggles[toggle]
- -- // Callback Function \\ --
- coroutine.resume(coroutine.create(function()
- callback(self.toggles[toggle])
- end))
- -- // Rainbowify and Unrainbowify \\ --
- coroutine.resume(coroutine.create(function()
- if (guiOptions.rainbowMode == true) then
- if (self.toggles[toggle] == true) then
- window:Rainbowify(-1, toggle, "TextColor3")
- else
- window:Unrainbowify(toggle)
- end
- end
- end))
- end)
- -- // Resize Window Instantly \\ --
- self:Resize()
- -- // Return The Toggle For Use \\ --
- return toggle
- end
- -- // Gui Functions : Toggle Gui \\ --
- coroutine.resume(coroutine.create(function()
- window.bar.MouseButton2Click:Connect(function()
- window.open = not window.open
- if (window.open == true) then
- window:Resize(true)
- else
- window:Resize(true, UDim2.new(0.95,0,0,0))
- end
- end)
- end))
- -- // Gui Extras : Rainbow Mode \\ --
- if (guiOptions.rainbowMode == true) then
- window:Rainbowify(-1, window.bar)
- window:Rainbowify(-1, self.title, "TextColor3")
- end
- -- // Add Window To Library \\ --
- table.insert(library.windows, window)
- -- // Return The Window For Usage \\ --
- return window
- end
- return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement