Advertisement
Ppnikabut

Freeze after catch

Jun 20th, 2025 (edited)
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.65 KB | None | 0 0
  1. -- 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)
  2.  
  3. local Players = game:GetService("Players")
  4. local RunService = game:GetService("RunService")
  5. local StatsService = game:GetService("Stats")
  6. local Lighting = game:GetService("Lighting")
  7.  
  8. local lp = Players.LocalPlayer
  9. local char = lp.Character or lp.CharacterAdded:Wait()
  10. local hrp = char:WaitForChild("HumanoidRootPart")
  11. local humanoid = char:WaitForChild("Humanoid")
  12.  
  13. -- Function to check if player is quarterback
  14. local function isQuarterback()
  15.     local posVal = char:FindFirstChild("Position")
  16.     return posVal and posVal.Value == "Quarterback"
  17. end
  18.  
  19. -- FPS Unlocker: cap at 120 FPS if function available
  20. if setfpscap then
  21.     pcall(function()
  22.         setfpscap(120)
  23.     end)
  24. end
  25.  
  26. -- Remove textures
  27. local function removeTextures()
  28.     for _, obj in pairs(workspace:GetDescendants()) do
  29.         if obj:IsA("Texture") or obj:IsA("Decal") or obj:IsA("SurfaceAppearance") then
  30.             pcall(function() obj:Destroy() end)
  31.         end
  32.     end
  33. end
  34. removeTextures()
  35.  
  36. -- GUI Setup
  37. local ScreenGui = Instance.new("ScreenGui")
  38. ScreenGui.Name = "FreezeToggleGui"
  39. ScreenGui.ResetOnSpawn = false
  40. ScreenGui.IgnoreGuiInset = true
  41. ScreenGui.Parent = lp:WaitForChild("PlayerGui")
  42.  
  43. local Frame = Instance.new("Frame")
  44. Frame.Size = UDim2.new(0, 170, 0, 60)
  45. Frame.Position = UDim2.new(0, 20, 0, 100)
  46. Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  47. Frame.BorderSizePixel = 0
  48. Frame.Active = true
  49. Frame.Draggable = true
  50. Frame.Selectable = true
  51. Frame.Parent = ScreenGui
  52.  
  53. local Title = Instance.new("TextLabel")
  54. Title.Size = UDim2.new(1, 0, 0.5, 0)
  55. Title.Position = UDim2.new(0, 0, 0, 0)
  56. Title.Text = "Freeze Jump Toggle"
  57. Title.TextColor3 = Color3.new(1, 1, 1)
  58. Title.BackgroundTransparency = 1
  59. Title.Font = Enum.Font.SourceSansBold
  60. Title.TextSize = 16
  61. Title.Parent = Frame
  62.  
  63. local ToggleButton = Instance.new("TextButton")
  64. ToggleButton.Size = UDim2.new(1, -10, 0.4, 0)
  65. ToggleButton.Position = UDim2.new(0, 5, 0.55, 0)
  66. ToggleButton.Text = "Freeze: ON"
  67. ToggleButton.BackgroundColor3 = Color3.fromRGB(0, 200, 100)
  68. ToggleButton.TextColor3 = Color3.new(1, 1, 1)
  69. ToggleButton.Font = Enum.Font.SourceSansBold
  70. ToggleButton.TextSize = 16
  71. ToggleButton.AutoButtonColor = true
  72. ToggleButton.Parent = Frame
  73.  
  74. local freezeEnabled = true
  75. ToggleButton.MouseButton1Click:Connect(function()
  76.     freezeEnabled = not freezeEnabled
  77.     ToggleButton.Text = freezeEnabled and "Freeze: ON" or "Freeze: OFF"
  78.     ToggleButton.BackgroundColor3 = freezeEnabled and Color3.fromRGB(0, 200, 100) or Color3.fromRGB(200, 50, 50)
  79. end)
  80.  
  81. -- FPS & Ping Display in upper right corner
  82. local statsGui = Instance.new("TextLabel")
  83. statsGui.Name = "StatsLabel"
  84. statsGui.Size = UDim2.new(0, 200, 0, 50)
  85. statsGui.Position = UDim2.new(1, -210, 0, 10) -- upper right corner with 10px padding
  86. statsGui.AnchorPoint = Vector2.new(0, 0)
  87. statsGui.BackgroundTransparency = 1
  88. statsGui.TextColor3 = Color3.new(1, 1, 1)
  89. statsGui.TextStrokeTransparency = 0.5
  90. statsGui.Font = Enum.Font.SourceSansBold
  91. statsGui.TextSize = 18
  92. statsGui.TextXAlignment = Enum.TextXAlignment.Right
  93. statsGui.Text = ""
  94. statsGui.Parent = ScreenGui
  95.  
  96. -- Variables to calculate FPS manually
  97. local frameCount = 0
  98. local elapsedTime = 0
  99.  
  100. RunService.RenderStepped:Connect(function(dt)
  101.     frameCount += 1
  102.     elapsedTime += dt
  103.     if elapsedTime >= 1 then
  104.         local fps = frameCount
  105.         frameCount = 0
  106.         elapsedTime = 0
  107.  
  108.         local ping = "N/A"
  109.         local pingStat = StatsService:FindFirstChild("PerformanceStats")
  110.         if pingStat and pingStat:FindFirstChild("Ping") then
  111.             ping = math.floor(pingStat.Ping:GetValue()) .. " ms"
  112.         end
  113.  
  114.         statsGui.Text = "FPS: " .. fps .. " | Ping: " .. ping
  115.     end
  116. end)
  117.  
  118. -- Ball hike detection & freeze at jump peak only when player has ball, ball is hiked, and not QB
  119.  
  120. local ballHiked = false
  121. local ball = workspace:FindFirstChild("football") -- ball named "football"
  122.  
  123. local startBallPos = ball and ball.Position or nil
  124.  
  125. local function checkBallHiked()
  126.     if not ball or not startBallPos then return false end
  127.     local dist = (ball.Position - startBallPos).Magnitude
  128.     return dist > 1 -- ball moved more than 1 stud means hike started
  129. end
  130.  
  131. RunService.Heartbeat:Connect(function()
  132.     if not ballHiked and checkBallHiked() then
  133.         ballHiked = true
  134.     end
  135. end)
  136.  
  137. local function playerHasBall()
  138.     if ball and ball.Parent == char then
  139.         return true
  140.     end
  141.     return false
  142. end
  143.  
  144. local alreadyFrozen = false
  145. local jumping = false
  146.  
  147. humanoid.StateChanged:Connect(function(_, new)
  148.     if not freezeEnabled then return end
  149.  
  150.     if new == Enum.HumanoidStateType.Jumping then
  151.         jumping = true
  152.     elseif new == Enum.HumanoidStateType.Freefall then
  153.         if jumping and not alreadyFrozen then
  154.             if ballHiked and playerHasBall() and not isQuarterback() then
  155.                 task.spawn(function()
  156.                     while hrp.Velocity.Y > 0 do task.wait() end
  157.                     alreadyFrozen = true
  158.                     local originalAnchored = hrp.Anchored
  159.                     hrp.Anchored = true
  160.                     task.wait(0.85)
  161.                     if hrp then
  162.                         hrp.Anchored = originalAnchored
  163.                         alreadyFrozen = false
  164.                         jumping = false
  165.                     end
  166.                 end)
  167.             else
  168.                 jumping = false
  169.             end
  170.         end
  171.     elseif new == Enum.HumanoidStateType.Landed then
  172.         jumping = false
  173.     end
  174. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement