I am looking for a method that I would use that would be able to send someone flying via a hit of a weapon. Similar to this game Fisticuffs
2 Likes
Check if a player touched the weapon, insert a body velocity into the player’s humanoid root part and set the velocity to your likings.
Demonstration:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildWhichIsA("Humanoid") then
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.Velocity = Vector3.new(0, 230, 400)
bodyVelocity.Parent = hit.Parent.HumanoidRootPart
end
end)
3 Likes
That function is deprecated, do you know the new way of doing this?
1 Like
Use a vector force instead. Very similar usage overall although you can do relativity with a VectorForce.
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildWhichIsA("Humanoid") then
local vForce = Instance.new("VectorForce")
vForce.Force = Vector3.new(0, 230, 400)
vForce.Parent = hit.Parent.HumanoidRootPart
end
end)
Properties of a VectorForce
1 Like