Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// SERVICES
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local Lighting = game:GetService("Lighting")
- local VirtualUser = game:GetService("VirtualUser")
- local player = Players.LocalPlayer
- local playerGui = player:WaitForChild("PlayerGui")
- --// REMOVE OLD GUI
- local oldGui = playerGui:FindFirstChild("CustomUI")
- if oldGui then
- oldGui:Destroy()
- end
- --// SAVE ORIGINAL LIGHTING SETTINGS
- local originalLighting = {
- FogStart = Lighting.FogStart,
- FogEnd = Lighting.FogEnd,
- GlobalShadows = Lighting.GlobalShadows,
- Brightness = Lighting.Brightness,
- ClockTime = Lighting.ClockTime,
- EnvironmentDiffuseScale = Lighting.EnvironmentDiffuseScale,
- EnvironmentSpecularScale = Lighting.EnvironmentSpecularScale,
- OutdoorAmbient = Lighting.OutdoorAmbient
- }
- --// GUI SETUP
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "CustomUI"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = playerGui
- local mainFrame = Instance.new("Frame")
- mainFrame.Name = "BlackFrame"
- mainFrame.Size = UDim2.new(0, 300, 0, 150)
- mainFrame.Position = UDim2.new(0.5, -150, 0.5, -75)
- mainFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- mainFrame.BackgroundTransparency = 0.3
- mainFrame.BorderSizePixel = 0
- mainFrame.Active = true
- mainFrame.Draggable = true
- mainFrame.Parent = screenGui
- --// ROUNDING
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 12)
- corner.Parent = mainFrame
- --// TITLE
- local title = Instance.new("TextLabel")
- title.Name = "Title"
- title.Size = UDim2.new(1, 0, 0, 30)
- title.Position = UDim2.new(0, 0, 0, 0)
- title.BackgroundTransparency = 1
- title.Text = "FPS Booster made By: Rojhann"
- title.TextColor3 = Color3.fromRGB(0, 255, 0)
- title.TextScaled = true
- title.Font = Enum.Font.GothamBold
- title.Parent = mainFrame
- --// BUTTON
- local fpsButton = Instance.new("TextButton")
- fpsButton.Name = "FPSButton"
- fpsButton.Size = UDim2.new(0.8, 0, 0, 40)
- fpsButton.Position = UDim2.new(0.1, 0, 0, 40)
- fpsButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- fpsButton.BackgroundTransparency = 0.3
- fpsButton.Text = "FPS On"
- fpsButton.TextScaled = true
- fpsButton.Font = Enum.Font.GothamBold
- fpsButton.TextColor3 = Color3.fromRGB(0, 255, 0)
- fpsButton.Parent = mainFrame
- local buttonCorner = Instance.new("UICorner")
- buttonCorner.CornerRadius = UDim.new(0, 12)
- buttonCorner.Parent = fpsButton
- --// COLOR ANIMATION
- local greenColors = {
- Color3.fromRGB(0, 255, 0),
- Color3.fromRGB(0, 200, 0),
- Color3.fromRGB(0, 150, 0),
- Color3.fromRGB(100, 255, 100),
- Color3.fromRGB(0, 128, 0)
- }
- task.spawn(function()
- local index = 1
- while true do
- local color = greenColors[index]
- title.TextColor3 = color
- fpsButton.TextColor3 = color
- index += 1
- if index > #greenColors then index = 1 end
- task.wait(1)
- end
- end)
- --// BOOST TOGGLES
- local fpsEnabled = false
- local afkConnection = nil
- local disconnectLoop = nil
- local function enableBoost()
- -- MAX FPS
- pcall(function()
- if setfpscap then setfpscap(10000) end
- if setfpscapinternal then setfpscapinternal(10000) end
- end)
- -- ANTI-AFK
- afkConnection = player.Idled:Connect(function()
- VirtualUser:Button2Down(Vector2.new(0,0), workspace.CurrentCamera.CFrame)
- wait(1)
- VirtualUser:Button2Up(Vector2.new(0,0), workspace.CurrentCamera.CFrame)
- end)
- -- ANTI-KICK LOOP
- disconnectLoop = task.spawn(function()
- while fpsEnabled do
- wait(10)
- -- dummy loop to simulate activity
- end
- end)
- -- REMOVE FOG
- Lighting.FogEnd = 1e10
- Lighting.FogStart = 1e10
- -- DISABLE PARTICLES & EFFECTS
- for _, v in pairs(workspace:GetDescendants()) do
- if v:IsA("ParticleEmitter") or v:IsA("Trail") or v:IsA("Smoke") or v:IsA("Fire") or v:IsA("Sparkles") then
- v.Enabled = false
- end
- end
- end
- local function disableBoost()
- -- RESET FPS
- pcall(function()
- if setfpscap then setfpscap(60) end
- end)
- -- DISCONNECT ANTI-AFK
- if afkConnection then
- afkConnection:Disconnect()
- afkConnection = nil
- end
- if disconnectLoop then
- task.cancel(disconnectLoop)
- disconnectLoop = nil
- end
- -- RESTORE FOG
- Lighting.FogStart = originalLighting.FogStart
- Lighting.FogEnd = originalLighting.FogEnd
- -- RESTORE EFFECTS
- for _, v in pairs(workspace:GetDescendants()) do
- if v:IsA("ParticleEmitter") or v:IsA("Trail") or v:IsA("Smoke") or v:IsA("Fire") or v:IsA("Sparkles") then
- v.Enabled = true
- end
- end
- end
- --// BUTTON FUNCTION
- fpsButton.MouseButton1Click:Connect(function()
- fpsEnabled = not fpsEnabled
- if fpsEnabled then
- fpsButton.Text = "FPS Off"
- enableBoost()
- else
- fpsButton.Text = "FPS On"
- disableBoost()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment