Update kb.lua

master
Minetest-j45 2021-03-20 21:54:19 +00:00 committed by GitHub
parent 8772d22247
commit 86ac7efca9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 8 deletions

15
kb.lua
View File

@ -1,10 +1,9 @@
minetest.calculate_knockback = function(player, hitter, time_from_last_punch, tool_capabilities, dir, distance, damage)
if not time_from_last_punch then return end
if time_from_last_punch >= 1.5 then
return 1.5
elseif time_from_last_punch <= 1 and time_from_last_punch >= 0.5 then
return 1
else
return 0.5
end
if not time_from_last_punch or time_from_last_punch >= 1.5 then
return 1.5
elseif time_from_last_punch <= 1 and time_from_last_punch >= 0.5 then
return 1
else
return 0.5
end
end