I need help with BodyVelocity. When i use it it is really really slow
It was working fine until I changed it from -victim.HumanoidRootPart.CFrame.LookVector to shown below
local tool = script.Parent
local cool = true
local mouse = script.Parent.Parent.Parent:GetMouse()
local lookvector = workspace.CurrentCamera.CFrame.LookVector
local y = workspace.CurrentCamera.CFrame.LookVector.Y
local x = workspace.CurrentCamera.CFrame.LookVector.X
local z = workspace.CurrentCamera.CFrame.LookVector.z
script.Parent.Knockback.OnServerEvent:Connect(function(player, victim, hit)
if cool == true then
if (victim.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).magnitude <= 10000 and (not victim:FindFirstChild("PushForce")) then
local pushforce = Instance.new("BodyVelocity")
lookvector = Vector3.new(lookvector.X,0.15,lookvector.Z)
pushforce.Name = "PushForce"
pushforce.MaxForce = Vector3.new(math.random(35000,100000), math.random(35000,100000), math.random(35000,100000))
print(pushforce.MaxForce)-- amount of force
pushforce.Velocity = (lookvector)*100
pushforce.Parent = victim.HumanoidRootPart
cool = false
wait(0.2)
pushforce:Destroy()
wait(1)
cool = true
end
end
end)