Nullify velocity and acceleration if player is below y < 50

This commit is contained in:
ANAND 2019-10-06 10:15:41 +00:00 committed by Auke Kok
parent 3099dd6228
commit a7403d6600

View File

@ -110,6 +110,8 @@ local function player_health_adjust()
local hp = player:get_hp() local hp = player:get_hp()
if player:getpos().y < -50 and hp > 0 then if player:getpos().y < -50 and hp > 0 then
player:set_hp(hp - 100) player:set_hp(hp - 100)
player:set_velocity({x = 0, y = 0, z = 0})
player:set_acceleration({x = 0, y = 0, z = 0})
else else
local breath = player:get_breath() local breath = player:get_breath()
if hp > 0 and hp < 20 and breath > 0 then if hp > 0 and hp < 20 and breath > 0 then