Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I "Push" the target player's body upon hit?

I don't really know how to go about scripting a "Push" how should I approach it? This is a snippit of the script, the part where I want the player to be pushed away. I want hum1, the target to be pushed away from the user. Also it is an attempt at rasengan from Naruto Lol.

Please Help... this is killing me

rasen.Handle.Touched:Connect(function(tag)
	local hum1 = tag.Parent:FindFirstChild("Humanoid")
local animtrack2 = hum1:LoadAnimation(anim2)
			if hum1 ~= nil and db == false then hum1:TakeDamage(45)
				animtrack2:Play()
				animtrack1:Play()
				
				hum.WalkSpeed = 0
				hum1.WalkSpeed = 0
				rasen.Handle.explode.Playing = true
				hum1.Sit = true
				db = true
				local torso = hum1.Parent:FindFirstChild("Torso")
				local torso1 = char:FindFirstChild("Torso")

3 comments

0

By "push", do you mean fling them as if hit with a lot of force?

0

Yeah

1 answer

Use a Bodyvelocity

Insert a body velocity inside the enemy's Torso or HumanoidRootPart, and make them fly.

Link for better understanding:

https://developer.roblox.com/en-us/api-reference/class/BodyVelocity

You could use some lines like this ;

local bv = Instance.new("BodyVelocity")
bv.Parent = (The enemy's Torso or HumanoidRootPart)

bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge) -- This can be identified as the power

bv.Velocity = (Your torso/HumanoidRootPart) .CFrame.lookVector *100

This discussion is preserved as it was. New answers, comments, and votes are closed.