local Char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local UIS = game:GetService("UserInputService")
local Debounce = false
local humanoid = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
local freefall = true
UIS.InputBegan:Connect(function(input, gpe)
if humanoid:GetState() == Enum.HumanoidStateType.Jumping or humanoid:GetState() == Enum.HumanoidStateType.Freefall then
if input.KeyCode == Enum.KeyCode.Q then
Debounce = true
local velocity = Instance.new("BodyVelocity")
local Direction = Char.Humanoid.MoveDirection
if Direction.Magnitude > 0 then
velocity.Velocity = Direction*50
else
velocity.Velocity = Char.HumanoidRootPart.CFrame.lookVector*-50
end
velocity.Parent = Char.HumanoidRootPart
velocity.MaxForce = Vector3.new(math.huge, 0, math.huge)
game:GetService("Debris"):AddItem(velocity,.3)
wait(5)
Debounce = false
end
end
end)
#How would I prevent the player from moving up or down during the dash in this
1 messages · Page 1 of 1 (latest)