I have a really simple problem, I have a push script so a player can push another player, but when a player is being push they can’t move left or right until the body vector is destroyed. How would I fix this or is there an alternative I can use?
game.ReplicatedStorage.Push.OnServerEvent:Connect(function(player, toPush)
local playerRoot = player.Character:FindFirstChild("HumanoidRootPart")
local pushRoot = toPush:FindFirstChild("HumanoidRootPart")
if (playerRoot) and not playerRoot:FindFirstChild("PushF") and pushRoot and not pushRoot:FindFirstChild("PushF") then
local pushF = Instance.new("BodyVelocity")
pushF.Name = "PushF"
pushF.MaxForce = Vector3.new(1000000, 1000000, 1000000)
pushF.Velocity = (playerRoot.CFrame.LookVector) * 30
pushF.Parent = pushRoot
local tween = ts:Create(pushF, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {Velocity = Vector3.new(0)})
tween:Play()
wait(0.3)
pushF:Destroy()
end
end)