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

How do I make a Player fling backwards?

Asked by 6 years ago

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

Log in to vote
-1
Answered by 6 years ago

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")
0
Thank you! MRbraveDragon 374 — 6y
0
No problem. Void_Frost 571 — 6y
Ad
Log in to vote
6
Answered by 6 years ago

Use a BodyForce. To see more, click here.

0
So I would need to add Force to the Z Coordinate? MRbraveDragon 374 — 6y
1
read the wiki its not that hard to read hiimgoodpack 2009 — 6y

Answer this question