Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- FF2: Freeze at peak of jump for 0.85s with toggle GUI (Draggable & Mobile-Friendly, Fix false triggers, show FPS & Ping, remove textures, freeze only after ball hike, 120 FPS cap, exclude QB)
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local StatsService = game:GetService("Stats")
- local Lighting = game:GetService("Lighting")
- local lp = Players.LocalPlayer
- local char = lp.Character or lp.CharacterAdded:Wait()
- local hrp = char:WaitForChild("HumanoidRootPart")
- local humanoid = char:WaitForChild("Humanoid")
- -- Function to check if player is quarterback
- local function isQuarterback()
- local posVal = char:FindFirstChild("Position")
- return posVal and posVal.Value == "Quarterback"
- end
- -- FPS Unlocker: cap at 120 FPS if function available
- if setfpscap then
- pcall(function()
- setfpscap(120)
- end)
- end
- -- Remove textures
- local function removeTextures()
- for _, obj in pairs(workspace:GetDescendants()) do
- if obj:IsA("Texture") or obj:IsA("Decal") or obj:IsA("SurfaceAppearance") then
- pcall(function() obj:Destroy() end)
- end
- end
- end
- removeTextures()
- -- GUI Setup
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "FreezeToggleGui"
- ScreenGui.ResetOnSpawn = false
- ScreenGui.IgnoreGuiInset = true
- ScreenGui.Parent = lp:WaitForChild("PlayerGui")
- local Frame = Instance.new("Frame")
- Frame.Size = UDim2.new(0, 170, 0, 60)
- Frame.Position = UDim2.new(0, 20, 0, 100)
- Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- Frame.BorderSizePixel = 0
- Frame.Active = true
- Frame.Draggable = true
- Frame.Selectable = true
- Frame.Parent = ScreenGui
- local Title = Instance.new("TextLabel")
- Title.Size = UDim2.new(1, 0, 0.5, 0)
- Title.Position = UDim2.new(0, 0, 0, 0)
- Title.Text = "Freeze Jump Toggle"
- Title.TextColor3 = Color3.new(1, 1, 1)
- Title.BackgroundTransparency = 1
- Title.Font = Enum.Font.SourceSansBold
- Title.TextSize = 16
- Title.Parent = Frame
- local ToggleButton = Instance.new("TextButton")
- ToggleButton.Size = UDim2.new(1, -10, 0.4, 0)
- ToggleButton.Position = UDim2.new(0, 5, 0.55, 0)
- ToggleButton.Text = "Freeze: ON"
- ToggleButton.BackgroundColor3 = Color3.fromRGB(0, 200, 100)
- ToggleButton.TextColor3 = Color3.new(1, 1, 1)
- ToggleButton.Font = Enum.Font.SourceSansBold
- ToggleButton.TextSize = 16
- ToggleButton.AutoButtonColor = true
- ToggleButton.Parent = Frame
- local freezeEnabled = true
- ToggleButton.MouseButton1Click:Connect(function()
- freezeEnabled = not freezeEnabled
- ToggleButton.Text = freezeEnabled and "Freeze: ON" or "Freeze: OFF"
- ToggleButton.BackgroundColor3 = freezeEnabled and Color3.fromRGB(0, 200, 100) or Color3.fromRGB(200, 50, 50)
- end)
- -- FPS & Ping Display in upper right corner
- local statsGui = Instance.new("TextLabel")
- statsGui.Name = "StatsLabel"
- statsGui.Size = UDim2.new(0, 200, 0, 50)
- statsGui.Position = UDim2.new(1, -210, 0, 10) -- upper right corner with 10px padding
- statsGui.AnchorPoint = Vector2.new(0, 0)
- statsGui.BackgroundTransparency = 1
- statsGui.TextColor3 = Color3.new(1, 1, 1)
- statsGui.TextStrokeTransparency = 0.5
- statsGui.Font = Enum.Font.SourceSansBold
- statsGui.TextSize = 18
- statsGui.TextXAlignment = Enum.TextXAlignment.Right
- statsGui.Text = ""
- statsGui.Parent = ScreenGui
- -- Variables to calculate FPS manually
- local frameCount = 0
- local elapsedTime = 0
- RunService.RenderStepped:Connect(function(dt)
- frameCount += 1
- elapsedTime += dt
- if elapsedTime >= 1 then
- local fps = frameCount
- frameCount = 0
- elapsedTime = 0
- local ping = "N/A"
- local pingStat = StatsService:FindFirstChild("PerformanceStats")
- if pingStat and pingStat:FindFirstChild("Ping") then
- ping = math.floor(pingStat.Ping:GetValue()) .. " ms"
- end
- statsGui.Text = "FPS: " .. fps .. " | Ping: " .. ping
- end
- end)
- -- Ball hike detection & freeze at jump peak only when player has ball, ball is hiked, and not QB
- local ballHiked = false
- local ball = workspace:FindFirstChild("football") -- ball named "football"
- local startBallPos = ball and ball.Position or nil
- local function checkBallHiked()
- if not ball or not startBallPos then return false end
- local dist = (ball.Position - startBallPos).Magnitude
- return dist > 1 -- ball moved more than 1 stud means hike started
- end
- RunService.Heartbeat:Connect(function()
- if not ballHiked and checkBallHiked() then
- ballHiked = true
- end
- end)
- local function playerHasBall()
- if ball and ball.Parent == char then
- return true
- end
- return false
- end
- local alreadyFrozen = false
- local jumping = false
- humanoid.StateChanged:Connect(function(_, new)
- if not freezeEnabled then return end
- if new == Enum.HumanoidStateType.Jumping then
- jumping = true
- elseif new == Enum.HumanoidStateType.Freefall then
- if jumping and not alreadyFrozen then
- if ballHiked and playerHasBall() and not isQuarterback() then
- task.spawn(function()
- while hrp.Velocity.Y > 0 do task.wait() end
- alreadyFrozen = true
- local originalAnchored = hrp.Anchored
- hrp.Anchored = true
- task.wait(0.85)
- if hrp then
- hrp.Anchored = originalAnchored
- alreadyFrozen = false
- jumping = false
- end
- end)
- else
- jumping = false
- end
- end
- elseif new == Enum.HumanoidStateType.Landed then
- jumping = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement