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

How do you add a simple knockback system to a tool?

Asked by 4 years ago

This is how I did it but it doesn't work. Please help, thank you! <3

01local tool = script.Parent
02local head = tool.Head
03local swinging = false
04 
05tool.Activated:Connect(function()
06    local humanoid = tool.Parent:FindFirstChild("Humanoid")
07 
08    if humanoid then
09        local smash = tool.Smash
10        local smashTrack = humanoid:LoadAnimation(smash)
11 
12        smashTrack:Play()
13    end
14 
15    swinging = true
View all 28 lines...

Answer this question