How do you add a simple knockback system to a tool?
This is how I did it but it doesn't work. Please help, thank you! <3
01 | local tool = script.Parent |
05 | tool.Activated:Connect( function () |
06 | local humanoid = tool.Parent:FindFirstChild( "Humanoid" ) |
09 | local smash = tool.Smash |
10 | local smashTrack = humanoid:LoadAnimation(smash) |
20 | head.Touched:Connect( function (hit) |
21 | local humanoid = hit.Parent:FindFirstChild( "Humanoid" ) |
22 | if humanoid and swinging then |
23 | local bodyVelocity = Instance.new( "BodyVelocity" ) |
24 | bodyVelocity.MaxForce = Vector 3. new( 1000 , 1000 , 1000 ) |
25 | bodyVelocity.Velocity = (humanoid.HumanoidRootPart.CFrame.LookVector) * 100 |
26 | bodyVelocity.Parent = humanoid.HumanoidRootPart |