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
01 | rasen.Handle.Touched:Connect( function (tag) |
02 | local hum 1 = tag.Parent:FindFirstChild( "Humanoid" ) |
03 | local animtrack 2 = hum 1 :LoadAnimation(anim 2 ) |
04 | if hum 1 ~ = nil and db = = false then hum 1 :TakeDamage( 45 ) |
05 | animtrack 2 :Play() |
06 | animtrack 1 :Play() |
07 |
08 | hum.WalkSpeed = 0 |
09 | hum 1. WalkSpeed = 0 |
10 | rasen.Handle.explode.Playing = true |
11 | hum 1. Sit = true |
12 | db = true |
13 | local torso = hum 1. Parent:FindFirstChild( "Torso" ) |
14 | local torso 1 = char:FindFirstChild( "Torso" ) |
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 ;
1 | local bv = Instance.new( "BodyVelocity" ) |
2 | bv.Parent = (The enemy's Torso or HumanoidRootPart) |
3 |
4 | bv.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) -- This can be identified as the power |
5 |
6 | bv.Velocity = (Your torso/HumanoidRootPart) .CFrame.lookVector * 100 |