Advertisement
WAOKyoNaga

WS Other

Aug 1st, 2019
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.78 KB | None | 0 0
  1. uis = game:GetService("UserInputService")
  2. cg = game:GetService("CoreGui")
  3. sg = game:GetService("StarterGui")
  4. wp = game:GetService("Workspace")
  5. cmr = wp.Camera
  6. rs = game:GetService("ReplicatedStorage")
  7. rsd = game:GetService("RunService").RenderStepped
  8. lgt = game:GetService("Lighting")
  9. plrs = game:GetService("Players")
  10. lplr = plrs.LocalPlayer
  11. mouse = lplr:GetMouse()
  12.  
  13. if speedEN == nil then
  14.     speedEN = false
  15. end
  16.  
  17. if _G.speedDash == nil then
  18.     _G.speedDash = 50
  19. end
  20.  
  21. function SendChat(String) -- Send a chat to the game chat
  22.     sg:SetCore(
  23.         "ChatMakeSystemMessage",
  24.         {
  25.             Text = "[OUTPUT]: " .. String
  26.         }
  27.     )
  28. end
  29.  
  30. if tostring(speedEN) == "false" then
  31.     speedEN = true
  32.     down = false
  33.     velocity = Instance.new("BodyVelocity")
  34.     velocity.maxForce = Vector3.new(100000, 0, 100000)
  35.     ---vv Use that to change the speed v
  36.     gyro = Instance.new("BodyGyro")
  37.     gyro.maxTorque = Vector3.new(100000, 0, 100000)
  38.  
  39.     local hum = lplr.Character.Humanoid
  40.     function onButton1Down(mouse)
  41.         down = true
  42.         if lplr.Character:FindFirstChild("Torso") then
  43.             velocity.Parent = lplr.Character.Torso
  44.             gyro.Parent = lplr.Character.Torso
  45.         else
  46.             velocity.Parent = lplr.Character.UpperTorso
  47.             gyro.Parent = lplr.Character.UpperTorso
  48.         end
  49.         velocity.velocity = (hum.MoveDirection) * _G.speedDash
  50.         while down do
  51.             if not down then
  52.                 break
  53.             end
  54.             velocity.velocity = (hum.MoveDirection) * _G.speedDash
  55.             local refpos = gyro.Parent.Position + (gyro.Parent.Position - wp.CurrentCamera.CoordinateFrame.p).unit * 5
  56.             gyro.cframe = CFrame.new(gyro.Parent.Position, Vector3.new(refpos.x, gyro.Parent.Position.y, refpos.z))
  57.             wait(0.1)
  58.         end
  59.     end
  60.  
  61.     function onButton1Up(mouse)
  62.         velocity.Parent = nil
  63.         gyro.Parent = nil
  64.         down = false
  65.     end
  66.  
  67.     lplr.CharacterAdded:Connect(
  68.         function(characterModel)
  69.             wait(1)
  70.             velocity = Instance.new("BodyVelocity")
  71.             velocity.maxForce = Vector3.new(100000, 0, 100000)
  72.             ---vv Use that to change the speed v
  73.             gyro = Instance.new("BodyGyro")
  74.             gyro.maxTorque = Vector3.new(100000, 0, 100000)
  75.  
  76.             local hum = lplr.Character.Humanoid
  77.  
  78.             function onButton1Down(mouse)
  79.                 down = true
  80.                 if lplr.Character:FindFirstChild("Torso") then
  81.                     velocity.Parent = lplr.Character.Torso
  82.                     gyro.Parent = lplr.Character.Torso
  83.                 else
  84.                     velocity.Parent = lplr.Character.UpperTorso
  85.                     gyro.Parent = lplr.Character.UpperTorso
  86.                 end
  87.                 velocity.velocity = (hum.MoveDirection) * _G.speedDash
  88.                 while down do
  89.                     if not down then
  90.                         break
  91.                     end
  92.                     velocity.velocity = (hum.MoveDirection) * _G.speedDash
  93.                     local refpos =
  94.                         gyro.Parent.Position +
  95.                         (gyro.Parent.Position - workspace.CurrentCamera.CoordinateFrame.p).unit * 5
  96.                     gyro.cframe =
  97.                         CFrame.new(gyro.Parent.Position, Vector3.new(refpos.x, gyro.Parent.Position.y, refpos.z))
  98.                     wait(0.1)
  99.                 end
  100.             end
  101.  
  102.             function onButton1Up(mouse)
  103.                 velocity.Parent = nil
  104.                 gyro.Parent = nil
  105.                 down = false
  106.             end
  107.         end
  108.     )
  109.     --To Change the key in those 2 lines, replace the "q" with your desired key
  110.     function onSelected(mouse)
  111.         mouse.Button2Down:Connect(
  112.             function()
  113.                 if mouse.X / mouse.ViewSizeX == 0.5 then
  114.                     onButton1Down(mouse)
  115.                 end
  116.             end
  117.         )
  118.         mouse.Button2Up:Connect(
  119.             function()
  120.                 if mouse.X / mouse.ViewSizeX == 0.5 then
  121.                     onButton1Up(mouse)
  122.                 end
  123.             end
  124.         )
  125.     end
  126.  
  127.     onSelected(lplr:GetMouse())
  128. end
  129.  
  130. function changeDA(typeDA)
  131.     if typeDA == 0 then
  132.         _G.speedDash = _G.speedDash + 5
  133.     elseif typeDA == 1 then
  134.         if _G.speedDash >= 0 then
  135.             _G.speedDash = _G.speedDash - 5
  136.         end
  137.         if _G.speedDash < 0 then
  138.             _G.speedDash = 0
  139.         end
  140.     end
  141. end
  142.  
  143. mouse.KeyDown:connect(
  144.     function(keyDown)
  145.         if keyDown == "[" then
  146.             changeDA(0)
  147.             SendChat("Dash :" .. _G.speedDash)
  148.         end
  149.         if keyDown == "]" then
  150.             changeDA(1)
  151.             SendChat("Dash :" .. _G.speedDash)
  152.         end
  153.     end
  154. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement