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

How do I make a Player fling backwards?

So i'm working on a Punch script, and I wanted to script it that if a Player is punched, the Player goes flying backwards with force. How would I do that?

2 answers

✓ Accepted answer

Call the flyback function, and provide the character that you want to make fly backwards Variables can be adjusted for higher/longer flight, and so it flings backwards harder.

function flyback(char)
local back=Instance.new("BodyForce",char.Torso)
local up=Instance.new("BodyForce",char.Torso)
up.Force=Vector3.new(0,5000,0)
back.Force=char.Torso.CFrame.lookVector*-3000
wait(1)
back:Destroy()
up:Destroy()
print("Function ran")
end
wait(2)
flyback(script.Parent)
print("Called function")

2 comments

0

Thank you!

0

No problem.

Use a BodyForce. To see more, click here.

2 comments

0

So I would need to add Force to the Z Coordinate?

1

read the wiki its not that hard to read

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