Advertisement
SxScripting

String Double Tap W

Mar 6th, 2021
9,657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
  2. local UIS = game:GetService('UserInputService')
  3. local Run = Humanoid:LoadAnimation(script:WaitForChild("Run"))
  4. local S,Word,Running = " ", "W",false
  5.  
  6. UIS.InputBegan:Connect(function(Input,IsTyping)
  7. if IsTyping then return end
  8. if Input.KeyCode == Enum.KeyCode[Word] then
  9. S = S..Word
  10. end
  11.  
  12. delay(.3, function()
  13. if S ~= string.rep(Word,2) then S = "" end
  14. end)
  15.  
  16. if S == tostring(Input.KeyCode):gsub("Enum.KeyCode.",Word) then
  17. Running = true
  18. Run:Play()
  19. Humanoid.WalkSpeed = 32
  20. end
  21.  
  22. local ChangeEnd = UIS.InputEnded:Connect(function(Input)
  23. if Input.KeyCode == Enum.KeyCode[Word] then
  24. if S ~= Word then Running = false end
  25. end
  26. end)
  27.  
  28. repeat wait() until Running == false
  29. ChangeEnd:Disconnect()
  30. Run:Stop()
  31. Humanoid.WalkSpeed = 16
  32. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement