local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local LocalPlayer = Players.LocalPlayer
UserInputService.InputBegan:Connect(function(Input, GameProccessed)
if GameProccessed then
return
end
if Input.KeyCode == Enum.KeyCode.Q then
if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
local Root = LocalPlayer.Character.HumanoidRootPart
local Tweeninfo = TweenInfo.new(0.5)
local Tweentable = {
CFrame = Root.CFrame + (Root.CFrame.LookVector * 20)
}
local Tween = TweenService:Create(Root, Tweeninfo, Tweentable)
Tween:Play()
LocalPlayer.Character.Humanoid:SetAttribute("WalkSpeed", LocalPlayer.Character.Humanoid.WalkSpeed)
LocalPlayer.Character.Humanoid.WalkSpeed = 0
Tween.Completed:Wait()
LocalPlayer.Character.Humanoid.WalkSpeed = LocalPlayer.Character.Humanoid:GetAttribute("WalkSpeed")
end
end
end)
shoot my bad
I sent the version without the animation (I just put it back in might not be put in right)
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local LocalPlayer = Players.LocalPlayer
UserInputService.InputBegan:Connect(function(Input, GameProccessed)
if GameProccessed then
return
end
if Input.KeyCode == Enum.KeyCode.Q then
if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
local Root = LocalPlayer.Character.HumanoidRootPart
local Tweeninfo = TweenInfo.new(0.5)
local Tweentable = {
CFrame = Root.CFrame + (Root.CFrame.LookVector * 20)
}
local Track = LocalPlayer.Character.Humanoid:WaitForChild("Animator"):LoadAnimation(script.Roll)
local Tween = TweenService:Create(Root, Tweeninfo, Tweentable)
Tween:Play()
LocalPlayer.Character.Humanoid:SetAttribute("WalkSpeed", LocalPlayer.Character.Humanoid.WalkSpeed)
LocalPlayer.Character.Humanoid.WalkSpeed = 0
Track.Looped = true
Track:Play()
Tween.Completed:Wait()
Track:Stop()
LocalPlayer.Character.Humanoid.WalkSpeed = LocalPlayer.Character.Humanoid:GetAttribute("WalkSpeed")
end
end
end)