Cakey3101

Battlegrounds - Dash (35)

Nov 21st, 2025
1,064
0
Never
10
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.02 KB | Source Code | 0 0
  1. local ContextActionService = game:GetService("ContextActionService")
  2. local Players = game:GetService("Players")
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4. local TweenService = game:GetService("TweenService")
  5. local UserInputService = game:GetService("UserInputService")
  6. local Workspace = game:GetService("Workspace")
  7. local RunService = game:GetService("RunService")
  8.  
  9. local Remotes = ReplicatedStorage:WaitForChild("Remotes")
  10. local HitboxModule = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("HitboxModule"))
  11.  
  12. local OnCooldown = false
  13. local CooldownDuration = 1.5
  14.  
  15. local DashSpeed = 60
  16. local DashDuration = 0.3
  17. local DashRange = 8
  18.  
  19. local CurrentCharName = nil
  20. local CurrentCharInfo = nil
  21.  
  22. Remotes.ChangeCharacter.OnClientEvent:Connect(function(CharInfo)
  23.     CurrentCharName = CharInfo.Name
  24.     CurrentCharInfo = CharInfo
  25. end)
  26.  
  27. local DashKeys = { Enum.KeyCode.E }
  28.  
  29. local HeldKeys = { W = false, A = false, S = false, D = false }
  30.  
  31. local DashMobileButton
  32. local MobileButtonImage = `rbxassetid://16086340003`
  33. local MobileButtonPosition = UDim2.new(1, -125, 1, -125)
  34. local NormalImageColor = Color3.fromRGB(0, 0, 0)
  35. local CooldownImageColor = Color3.fromRGB(51, 51, 51)
  36.  
  37. local DashFOVIncrease = 15
  38. local DefaultFOV
  39.  
  40. local DashActionName = "DASH_ACTION"
  41.  
  42. local Camera = Workspace.CurrentCamera
  43. DefaultFOV = Camera.FieldOfView
  44.  
  45. local Character = script.Parent
  46. local RootPart: BasePart = Character:WaitForChild("HumanoidRootPart")
  47. local Humanoid: Humanoid = Character:WaitForChild("Humanoid")
  48. local Animator: Animator = Humanoid:WaitForChild("Animator")
  49.  
  50. local Attachment = Instance.new("Attachment")
  51. Attachment.Name = "DashAttachment0"
  52. Attachment.Parent = RootPart
  53.  
  54. local LinearVelocity = Instance.new("LinearVelocity")
  55. LinearVelocity.Attachment0 = Attachment
  56. LinearVelocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Plane
  57. LinearVelocity.PrimaryTangentAxis = Vector3.new(1, 0, 0)
  58. LinearVelocity.SecondaryTangentAxis = Vector3.new(0, 0, 1)
  59. LinearVelocity.MaxForce = math.huge
  60. LinearVelocity.Enabled = false
  61. LinearVelocity.Parent = RootPart
  62.  
  63. local DashSound = script:WaitForChild("DashSound")
  64. DashSound.Parent = RootPart
  65.  
  66. local DashForwardAnim = Animator:LoadAnimation(script:WaitForChild("DashForward"))
  67. local DashLeftAnim = Animator:LoadAnimation(script:WaitForChild("DashLeft"))
  68. local DashBackAnim = Animator:LoadAnimation(script:WaitForChild("DashBack"))
  69. local DashRightAnim = Animator:LoadAnimation(script:WaitForChild("DashRight"))
  70.  
  71. local RaycastParameters = RaycastParams.new()
  72. RaycastParameters.FilterDescendantsInstances = { Character }
  73. RaycastParameters.FilterType = Enum.RaycastFilterType.Exclude
  74.  
  75. function Lerp(A: number, B: number, T: number)
  76.     return A + (B - A) * T
  77. end
  78.  
  79. function IsDashAllowed(ActionName: string, InputState: Enum.UserInputState)
  80.     if OnCooldown then return false end
  81.     if ActionName ~= DashActionName then return false end
  82.     if InputState ~= Enum.UserInputState.Begin then return false end
  83.     if Character:GetAttribute("CanDash") == false then return false end
  84.  
  85.     return true
  86. end
  87.  
  88. function GetDashVelocity()
  89.     local VectorMask = Vector3.new(1, 0, 1)
  90.     local Direction = RootPart.AssemblyLinearVelocity * VectorMask
  91.  
  92.     if Direction.Magnitude <= 0.1 then
  93.         Direction = Camera.CFrame.LookVector * VectorMask
  94.     end
  95.  
  96.     Direction = Direction.Unit
  97.     local PlaneDirection = Vector2.new(Direction.X, Direction.Z)
  98.  
  99.     local DashVelocity = PlaneDirection * DashSpeed
  100.  
  101.     return DashVelocity
  102. end
  103.  
  104. function PlayDashAnimation()
  105.     DashForwardAnim:Stop()
  106.     DashLeftAnim:Stop()
  107.     DashRightAnim:Stop()
  108.     DashBackAnim:Stop()
  109.  
  110.     if UserInputService.MouseBehavior ~= Enum.MouseBehavior.LockCenter then
  111.         DashForwardAnim:Play()
  112.         return
  113.     end
  114.  
  115.     if HeldKeys.W then
  116.         DashForwardAnim:Play()
  117.         return
  118.  
  119.     elseif HeldKeys.A then
  120.         DashLeftAnim:Play()
  121.         return
  122.  
  123.     elseif HeldKeys.S then
  124.         DashRightAnim:Play()
  125.         return
  126.  
  127.     elseif HeldKeys.D then
  128.         DashBackAnim:Play()
  129.         return
  130.     end
  131.  
  132.     DashForwardAnim:Play()
  133. end
  134.  
  135. function HandleCooldown()
  136.     if DashMobileButton then
  137.         DashMobileButton.ImageColor3 = CooldownImageColor
  138.     end
  139.  
  140.     local CooldownStarted = tick()
  141.     local LastTick = tick()
  142.  
  143.     while tick() - CooldownStarted < CooldownDuration do
  144.         RunService.PostSimulation:Wait()
  145.  
  146.         local DeltaTime = tick() - LastTick
  147.         LastTick = tick()
  148.  
  149.         local StartFOV
  150.         if LinearVelocity.Enabled == false then
  151.             if Camera.FieldOfView > DefaultFOV then
  152.                 if not StartFOV then
  153.                     StartFOV = Camera.FieldOfView
  154.                 end
  155.  
  156.                 local LerpAmount = DeltaTime * 10
  157.                 local NewFOV = Lerp(StartFOV, DefaultFOV, LerpAmount)
  158.  
  159.                 Camera.FieldOfView = NewFOV
  160.             end
  161.         end
  162.     end
  163.  
  164.     Camera.FieldOfView = DefaultFOV
  165.  
  166.     if DashMobileButton then
  167.         DashMobileButton.ImageColor3 = NormalImageColor
  168.     end
  169.  
  170.     OnCooldown = false
  171. end
  172.  
  173. function HandleDashDuration()
  174.     local DashStarted = tick()
  175.     local StartFOV = Camera.FieldOfView
  176.     local GoalFOV = DefaultFOV + DashFOVIncrease
  177.     local LastTick = tick()
  178.  
  179.     while tick() - DashStarted < DashDuration do
  180.         RunService.PostSimulation:Wait()
  181.  
  182.         if Camera.FieldOfView < GoalFOV then
  183.             local DeltaTime = tick() - LastTick
  184.             LastTick = tick()
  185.  
  186.             local LerpAmount = DeltaTime * 20
  187.             local NewFOV = Lerp(Camera.FieldOfView, GoalFOV, LerpAmount)
  188.  
  189.             Camera.FieldOfView = NewFOV
  190.         end
  191.  
  192.         if IsDashBlocked() then
  193.             break
  194.         end
  195.     end
  196. end
  197.  
  198. function IsDashBlocked()
  199.     local RayOrigin = RootPart.Position
  200.     local RayDirection = RootPart.CFrame.LookVector
  201.     local RayDepth = DashRange
  202.  
  203.     local Raycast = Workspace:Raycast(RayOrigin, RayDirection * RayDepth, RaycastParameters)
  204.  
  205.     if Raycast and Raycast.Instance.CanCollide and Raycast.Instance.Anchored then
  206.         return true
  207.     end
  208. end
  209.  
  210. function DashEffects()
  211.     DashSound:Play()
  212. end
  213.  
  214. function EnableLinearVelocity(DashVelocity: Vector2)
  215.     LinearVelocity.PlaneVelocity = DashVelocity
  216.     LinearVelocity.Enabled = true
  217.  
  218.     RootPart.CFrame = CFrame.new(RootPart.Position, Vector3.new(DashVelocity.X, 0, DashVelocity.Y * 1000))
  219. end
  220.  
  221. function DisableLinearVelocity()
  222.     LinearVelocity.Enabled = false
  223. end
  224.  
  225. task.delay(0, function()
  226.     if not CurrentCharInfo then
  227.         local SelectedChar, CharDataTable = Remotes.GetCharacterInfo:InvokeServer()
  228.  
  229.         if SelectedChar and CharDataTable then
  230.             CurrentCharName = SelectedChar
  231.             CurrentCharInfo = CharDataTable
  232.         end
  233.     end
  234. end)
  235.  
  236. function Dash(ActionName: string, InputState: Enum.UserInputState)
  237.     if DashMobileButton then
  238.         DashMobileButton.Image = MobileButtonImage
  239.     end
  240.  
  241.     if IsDashAllowed(ActionName, InputState) then
  242.         if CurrentCharInfo == nil then
  243.             return
  244.         end
  245.  
  246.         if Humanoid and Humanoid.Health <= 0 then
  247.             return
  248.         end
  249.        
  250.         OnCooldown = true
  251.         task.spawn(HandleCooldown)
  252.  
  253.         PlayDashAnimation()
  254.  
  255.         local DashVelocity = GetDashVelocity()
  256.         EnableLinearVelocity(DashVelocity)
  257.         DashEffects()
  258.         HandleDashDuration()
  259.         DisableLinearVelocity()
  260.        
  261.         task.wait(0.3)
  262.  
  263.         Remotes.Attack:FireServer(1, "Normal")
  264.     end
  265. end
  266.  
  267. ContextActionService:BindAction(DashActionName, Dash, true, unpack(DashKeys))
  268.  
  269. DashMobileButton = ContextActionService:GetButton(DashActionName)
  270.  
  271. if DashMobileButton then
  272.     DashMobileButton.Image = MobileButtonImage
  273.     DashMobileButton.ImageColor3 = NormalImageColor
  274.     DashMobileButton.Position = MobileButtonPosition
  275. end
  276.  
  277. UserInputService.InputBegan:Connect(function(Input: InputObject, GameProcessedEvent: boolean)
  278.     if not GameProcessedEvent then
  279.         if Input.KeyCode == Enum.KeyCode.W then
  280.             HeldKeys.W = true
  281.         elseif Input.KeyCode == Enum.KeyCode.S then
  282.             HeldKeys.S = true
  283.         elseif Input.KeyCode == Enum.KeyCode.A then
  284.             HeldKeys.A = true
  285.         elseif Input.KeyCode == Enum.KeyCode.D then
  286.             HeldKeys.D = true
  287.         end
  288.     end
  289. end)
  290.  
  291. UserInputService.InputEnded:Connect(function(Input: InputObject, GameProcessedEvent: boolean)
  292.     if not GameProcessedEvent then
  293.         if Input.KeyCode == Enum.KeyCode.W then
  294.             HeldKeys.W = false
  295.         elseif Input.KeyCode == Enum.KeyCode.S then
  296.             HeldKeys.S = false
  297.         elseif Input.KeyCode == Enum.KeyCode.A then
  298.             HeldKeys.A = false
  299.         elseif Input.KeyCode == Enum.KeyCode.D then
  300.             HeldKeys.D = false
  301.         end
  302.     end
  303. end)
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Wayikri
    20 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • Dolunny
    17 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • Obhunad
    2 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=mqjsfuzqfq
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment