How to do knockback using a tool like in Slap Battles

Hello developers, :wave:

I want to figure out how to deal knockback on a player but similar to Slap Battles’ knockback system. I’ve been looking around for solutions, however nothing works I tried using BodyVelocity but it still didn’t work and I don’t understand how to make the properties work so it makes the character experience knockback.


Can we see your script? It will let me see what is wrong with your bodyvelocity

Anything in the toolbox? Might give you a good start.

Usually with knockback, they use a sudden huge force and delete the force a fraction of a second later. You can use bodyvelocity.

create velocity > set velocity to high numbers > wait 0.2 seconds > delete velocity > player go flying back a bit

try BasePart:ApplyImpulse(Vector3)
it applies a 1 time force to the part

You’re most likely using R6. If you want to implement a ragdoll system consider this one:
Ragdoll 5.2.rbxm (7.8 KB)
I made a game similar to this one and I used a temporary LinearVelocity object that was destroyed 0.2 seconds later. The only issue with LinearVelocity is that it doesn’t replicate the physics immediately, so you will need to implement a system that counteracts this issue or use BodyVelocity.

or just use apply impulse
seriously why do people make instances for constant force for a short burst when apply impulse was made for this

Replication lag can cause issues with ApplyImpulse and it might not work right if changing network owners.

The specific reason why I did it is to remain in compatibility of an older system I made that used BodyVelocity.

I tried looking on the toolbox, but all of them don’t work for some reason.

1 Like

Show your code so far when developing the knockback system, or add it into your original post.

local glove = script.Parent.Parent.Glove
local hand = script.Parent.Hand
local slap = script.Parent.Slap
local playerslapped = game.ReplicatedStorage:WaitForChild("PlayerSlapped")

playerslapped.OnServerEvent:Connect(function(player, targetedplayer, humanoid, locatedhead)
	local targetHumanoid = targetedplayer:WaitForChild("HumanoidRootPart")
	local playerHumanoid = player.Character:WaitForChild("HumanoidRootPart")
	if targetHumanoid and playerHumanoid then
		for _, v in pairs(targetedplayer:GetDescendants()) do
			if v:IsA("Motor6D") then
				local a0, a1 ="Attachment"),"Attachment")
				a0.CFrame = v.C0
				a1.CFrame = v.C1
				a0.Parent = v.Part0
				a1.Parent = v.Part1

				v.Part0.CanCollide = true
				v.Part1.CanCollide = true

				local b ="BallSocketConstraint")
				b.Attachment0 = a0
				b.Attachment1 = a1
				b.Parent = v.Part0

				v.Enabled = false
		local force ="LinearVelocity", targetHumanoid)
		force.MaxForce =,1.5,2) * math.huge
		local direction = (targetHumanoid.CFrame.Position - playerHumanoid.CFrame.Position).Unit
		force.VectorVelocity = (direction +,0.5,0)).Unit * 25

		local rotation ="BodyAngularVelocity",targetHumanoid)
		rotation.AngularVelocity =,0.7,1) * math.pi * math.random(1.9,2.9)
		rotation.MaxTorque =,1.5,1.5) * math.huge
		rotation.P = 3600

	targetedplayer.HumanoidRootPart.CanCollide = false

Most of these were copied

local velocity ="BodyVelocity",hit.Parent.HumanoidRootPart)
		velocity.MaxForce =,3,3) * math.huge
		local dir = (hit.Parent.HumanoidRootPart.CFrame.Position - script.Parent.Parent.HumanoidRootPart.Position).Unit
		velocity.Velocity = (dir +,1,0)).Unit *script.Parent.Configuration.Power.Value

		local rot ="BodyAngularVelocity",hit.Parent.HumanoidRootPart)
		rot.AngularVelocity =,2,1) * math.pi *5
		rot.MaxTorque =,5,2) *math.huge
		rot.P = 5000

		game:GetService("Debris"):AddItem(velocity, 0.5)
1 Like

It works, but how do I make the targeted character ragdoll?

Nevermind, I figured it out, thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.