- This mod adds a new server-side Lua method
api:kickbackPlayer(player, reverse, power)
- and a new global variable
HEAVY_RECOIL_INSTALLED
- You can use the following snippet to knock players back in a specified direction when firing:
if (HEAVY_RECOIL_INSTALLED) then
api:kickbackPlayer(api:getShooter(), true, cache.KICKBACK.power)
end
player - The player instance.
reverse - When true, the knockback direction is backward; when false, it is forward.
power - The knockback strength. A value around 1 is recommended.