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

How can i make another NPC get pushed back on hit?

For ex: im doing a combo which is punch1, punch2, then kick and it sends the player backwards. Any idea on how i can do that?? I was thinking about using the onTouched function but im not sure how that would work out.

1 answer

✓ Accepted answer

I would say to put a BodyVelocity in the npc torso then do something with lookVector or something based on the npc's Torso's lookVector.

Maybe like this:

local velocity = Instance.new('BodyVelocity', (npc's torso)
velocity.MaxForce = 10000
velocity.Velocity = (npc's torso).CFrame.lookVector * Vector3.new(100, 0, 100)

2 comments

0

maybe u could also mess with just the velocity of the torso itself and not add a bodyvelocity.

0

Ohh, ok so i can just write when the player's arm hit the NPC's torso or so it makes a bodyvelocity?

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