Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
- local UIS = game:GetService('UserInputService')
- local Run = Humanoid:LoadAnimation(script:WaitForChild("Run"))
- local S,Word,Running = " ", "W",false
- UIS.InputBegan:Connect(function(Input,IsTyping)
- if IsTyping then return end
- if Input.KeyCode == Enum.KeyCode[Word] then
- S = S..Word
- end
- delay(.3, function()
- if S ~= string.rep(Word,2) then S = "" end
- end)
- if S == tostring(Input.KeyCode):gsub("Enum.KeyCode.",Word) then
- Running = true
- Run:Play()
- Humanoid.WalkSpeed = 32
- end
- local ChangeEnd = UIS.InputEnded:Connect(function(Input)
- if Input.KeyCode == Enum.KeyCode[Word] then
- if S ~= Word then Running = false end
- end
- end)
- repeat wait() until Running == false
- ChangeEnd:Disconnect()
- Run:Stop()
- Humanoid.WalkSpeed = 16
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement