Advertisement
Guest User

Blade Ball

a guest
Sep 11th, 2023
912
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 3 2
  1. local OrionLib = loadstring(game:HttpGet(('https://raw.githubusercontent.com/shlexware/Orion/main/source')))()
  2.  
  3. local Window = OrionLib:MakeWindow({Name = "BLADE BALL", HidePremium = false, IntroText = "Made By Faker", SaveConfig = true, ConfigFolder = "Blade Ball"})
  4.  
  5. local Tab = Window:MakeTab({
  6. Name = "Autoparry",
  7. Icon = "rbxassetid://13908444327",
  8. PremiumOnly = false
  9. })
  10.  
  11. local Section = Tab:AddSection({
  12. Name = "HyB Community"
  13. })
  14.  
  15. Tab:AddButton({
  16. Name = "AutoParry/Click this then go check console",
  17. Callback = function()
  18. print("Im Pro")
  19. end
  20. })
  21.  
  22. local player = game.Players.LocalPlayer
  23. local character = player.Character or player.CharacterAdded:Wait()
  24. local replicatedStorage = game:GetService("ReplicatedStorage")
  25. local runService = game:GetService("RunService")
  26. local parryButtonPress = replicatedStorage.Remotes.ParryButtonPress
  27. local ballsFolder = workspace:WaitForChild("Balls")
  28.  
  29. print("Script successfully ran.")
  30.  
  31. local function onCharacterAdded(newCharacter)
  32. character = newCharacter
  33. end
  34.  
  35. player.CharacterAdded:Connect(onCharacterAdded)
  36.  
  37. local focusedBall = nil
  38.  
  39. local function chooseNewFocusedBall()
  40. local balls = ballsFolder:GetChildren()
  41. focusedBall = nil
  42. for _, ball in ipairs(balls) do
  43. if ball:GetAttribute("realBall") == true then
  44. focusedBall = ball
  45. break
  46. end
  47. end
  48. end
  49.  
  50. chooseNewFocusedBall()
  51.  
  52. local function timeUntilImpact(ballVelocity, distanceToPlayer, playerVelocity)
  53. local directionToPlayer = (character.HumanoidRootPart.Position - focusedBall.Position).Unit
  54. local velocityTowardsPlayer = ballVelocity:Dot(directionToPlayer) - playerVelocity:Dot(directionToPlayer)
  55.  
  56. if velocityTowardsPlayer <= 0 then
  57. return math.huge
  58. end
  59.  
  60. local distanceToBeCovered = distanceToPlayer - 30
  61. return distanceToBeCovered / velocityTowardsPlayer
  62. end
  63.  
  64. local BASE_THRESHOLD = 0.15
  65. local VELOCITY_SCALING_FACTOR = 0.002
  66.  
  67. local function getDynamicThreshold(ballVelocityMagnitude)
  68. local adjustedThreshold = BASE_THRESHOLD - (ballVelocityMagnitude * VELOCITY_SCALING_FACTOR)
  69. return math.max(0.12, adjustedThreshold)
  70. end
  71.  
  72. local function checkBallDistance()
  73. if not character:FindFirstChild("Highlight") then return end
  74. local charPos = character.PrimaryPart.Position
  75. local charVel = character.PrimaryPart.Velocity
  76.  
  77. if focusedBall and not focusedBall.Parent then
  78. chooseNewFocusedBall()
  79. end
  80.  
  81. if not focusedBall then return end
  82.  
  83. local ball = focusedBall
  84. local distanceToPlayer = (ball.Position - charPos).Magnitude
  85.  
  86. if distanceToPlayer < 10 then
  87. parryButtonPress:Fire()
  88. return
  89. end
  90.  
  91. local timeToImpact = timeUntilImpact(ball.Velocity, distanceToPlayer, charVel)
  92. local dynamicThreshold = getDynamicThreshold(ball.Velocity.Magnitude)
  93.  
  94. if timeToImpact < dynamicThreshold then
  95. parryButtonPress:Fire()
  96. end
  97. end
  98.  
  99.  
  100.  
  101. runService.Heartbeat:Connect(function()
  102. checkBallDistance()
  103. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement