Knockback Module

Greetings! Im currently working on a knockback module script and its not going so hot, Inputs need to include the Player thats being knocked back, direction they needa get knocked back in, Distance / Power they get knocked back, And height they get knocked back

Ive tried pulling loads of knockback scripts online and modifing them to my needs but its not been working

Ty For any help!

1 Like

By online do you mean in the forums here? I’ve seen quite a few posts about knockback or pushback or punching scripts.
Try using different terms that other people might use in their posts when you search and you’ll probably get better results.

Yes i mean the fourms when i say “online”

Any more help? Characterlimmmmet

You could try something like this

local Knockback = {}

function Knockback.Apply(character, dir, force, duration)
    local bodyVelocity = Instance.new("BodyVelocity")
    bodyVelocity.Parent = -- character humanoid rootpart

    -- add velocity based on direction and force

    -- remove knockback effect after duration
    game:GetService("Debris"):AddItem(bodyVelocity, duration)
end

return Knockback

Ty so much! Im going to bed but ill try this tmr morning

1 Like

I remember seeing AppyImpulse is best for this because it is just like a pushing force, not an extended force that needs to be turned off again like BodyVelocity as @Xuadzilla suggested.

I tried searching “knockback applyimpulse” and found this tutorial about using the new character controllers.

Your a legend thanks for the help bro!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.