Advertisement
HugosOnTop

Untitled

Nov 18th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. local workspace = game:GetService("Workspace")
  2. local players = game:GetService("Players")
  3. local localPlayer = players.LocalPlayer
  4. local UserInputService = game:GetService("UserInputService")
  5. local replicatedStorage = game:GetService("ReplicatedStorage")
  6. local heartbeatConnection
  7.  
  8. local function startAutoParry()
  9. local player = game.Players.LocalPlayer
  10. local character = player.Character or player.CharacterAdded:Wait()
  11. local replicatedStorage = game:GetService("ReplicatedStorage")
  12. local runService = game:GetService("RunService")
  13. local parryButtonPress = replicatedStorage.Remotes.ParryButtonPress
  14. local ballsFolder = workspace:WaitForChild("Balls")
  15.  
  16. print("Script successfully ran.")
  17.  
  18. local function onCharacterAdded(newCharacter)
  19. character = newCharacter
  20. end
  21.  
  22. player.CharacterAdded:Connect(onCharacterAdded)
  23.  
  24. local focusedBall = nil
  25.  
  26. local function chooseNewFocusedBall()
  27. local balls = ballsFolder:GetChildren()
  28. focusedBall = nil
  29. for _, ball in ipairs(balls) do
  30. if ball:GetAttribute("realBall") == true then
  31. focusedBall = ball
  32. break
  33. end
  34. end
  35. end
  36.  
  37. chooseNewFocusedBall()
  38.  
  39. local function timeUntilImpact(ballVelocity, distanceToPlayer, playerVelocity)
  40. local directionToPlayer = (character.HumanoidRootPart.Position - focusedBall.Position).Unit
  41. local velocityTowardsPlayer = ballVelocity:Dot(directionToPlayer) - playerVelocity:Dot(directionToPlayer)
  42.  
  43. if velocityTowardsPlayer <= 0 then
  44. return math.huge
  45. end
  46.  
  47. local distanceToBeCovered = distanceToPlayer - 40
  48. return distanceToBeCovered / velocityTowardsPlayer
  49. end
  50.  
  51. local BASE_THRESHOLD = 0.15
  52. local VELOCITY_SCALING_FACTOR = 0.002
  53.  
  54. local function getDynamicThreshold(ballVelocityMagnitude)
  55. local adjustedThreshold = BASE_THRESHOLD - (ballVelocityMagnitude * VELOCITY_SCALING_FACTOR)
  56. return math.max(0.12, adjustedThreshold)
  57. end
  58.  
  59. local function checkBallDistance()
  60. if not character:FindFirstChild("Highlight") then return end
  61. local charPos = character.PrimaryPart.Position
  62. local charVel = character.PrimaryPart.Velocity
  63.  
  64. if focusedBall and not focusedBall.Parent then
  65. chooseNewFocusedBall()
  66. end
  67.  
  68. if not focusedBall then return end
  69.  
  70. local ball = focusedBall
  71. local distanceToPlayer = (ball.Position - charPos).Magnitude
  72.  
  73. if distanceToPlayer < 10 then
  74. parryButtonPress:Fire()
  75. return
  76. end
  77.  
  78. local timeToImpact = timeUntilImpact(ball.Velocity, distanceToPlayer, charVel)
  79. local dynamicThreshold = getDynamicThreshold(ball.Velocity.Magnitude)
  80.  
  81. if timeToImpact < dynamicThreshold then
  82. parryButtonPress:Fire()
  83. end
  84. end
  85. heartbeatConnection = game:GetService("RunService").Heartbeat:Connect(function()
  86. checkBallDistance()
  87. end)
  88. end
  89.  
  90. local function stopAutoParry()
  91. if heartbeatConnection then
  92. heartbeatConnection:Disconnect()
  93. heartbeatConnection = nil
  94. end
  95. end
  96.  
  97. -- Gui to Lua
  98. -- Version: 3.2
  99.  
  100. -- Instances:
  101.  
  102. local ScreenGui = Instance.new("ScreenGui")
  103. local Frame = Instance.new("Frame")
  104. local TextLabel = Instance.new("TextLabel")
  105. local TextButton = Instance.new("TextButton")
  106. local TextButton_2 = Instance.new("TextButton")
  107.  
  108. --Properties:
  109.  
  110. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  111. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  112.  
  113. Frame.Parent = ScreenGui
  114. Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  115. Frame.Position = UDim2.new(0.0833889097, 0, 0.562569201, 0)
  116. Frame.Size = UDim2.new(0, 230, 0, 160)
  117.  
  118. TextLabel.Parent = Frame
  119. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  120. TextLabel.Position = UDim2.new(-0.00203830888, 0, -0.00307044992, 0)
  121. TextLabel.Size = UDim2.new(0, 230, 0, 25)
  122. TextLabel.Font = Enum.Font.SourceSans
  123. TextLabel.Text = "Blade Ball Skidded Auto Parry - nfpw"
  124. TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  125. TextLabel.TextScaled = true
  126. TextLabel.TextSize = 14.000
  127. TextLabel.TextWrapped = true
  128.  
  129. TextButton.Parent = Frame
  130. TextButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  131. TextButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
  132. TextButton.Position = UDim2.new(0.0700469762, 0, 0.358639956, 0)
  133. TextButton.Size = UDim2.new(0.321920365, 0, 0.275855243, 0)
  134. TextButton.Font = Enum.Font.SourceSans
  135. TextButton.Text = "Enable"
  136. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  137. TextButton.TextScaled = true
  138. TextButton.TextSize = 14.000
  139. TextButton.TextStrokeTransparency = 0.000
  140. TextButton.TextWrapped = true
  141.  
  142. TextButton_2.Parent = Frame
  143. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  144. TextButton_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
  145. TextButton_2.Position = UDim2.new(0.591082573, 0, 0.358639956, 0)
  146. TextButton_2.Size = UDim2.new(0.321920365, 0, 0.275855243, 0)
  147. TextButton_2.Font = Enum.Font.SourceSans
  148. TextButton_2.Text = "Disable"
  149. TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  150. TextButton_2.TextScaled = true
  151. TextButton_2.TextSize = 14.000
  152. TextButton_2.TextStrokeTransparency = 0.000
  153. TextButton_2.TextWrapped = true
  154.  
  155. -- Scripts:
  156.  
  157. local function NHOVBS_fake_script() -- Frame.GuiDrag
  158. local script = Instance.new('LocalScript', Frame)
  159.  
  160. local Frame = script.Parent.Parent.Frame
  161.  
  162. Frame.Draggable = true
  163. Frame.Active = true
  164.  
  165.  
  166.  
  167. end
  168. coroutine.wrap(NHOVBS_fake_script)()
  169. local function HTPDFXZ_fake_script() -- TextButton.LocalScript
  170. local script = Instance.new('LocalScript', TextButton)
  171.  
  172. local startButton = script.Parent
  173.  
  174. startButton.MouseButton1Click:Connect(function()
  175. startAutoParry()
  176. end)
  177. end
  178. coroutine.wrap(HTPDFXZ_fake_script)()
  179. local function ZDNHQM_fake_script() -- TextButton_2.LocalScript
  180. local script = Instance.new('LocalScript', TextButton_2)
  181.  
  182. local stopButton = script.Parent
  183.  
  184. stopButton.MouseButton1Click:Connect(function()
  185. stopAutoParry()
  186. end)
  187. end
  188. coroutine.wrap(ZDNHQM_fake_script)()
  189.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement