Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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")
0
By "push", do you mean fling them as if hit with a lot of force? LukeSmasher 619 — 4y
0
Yeah RemyKing_XL 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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
Ad

Answer this question