Kill falling players
This commit is contained in:
parent
8472fb955c
commit
eb24093f79
@ -94,3 +94,4 @@ dofile(minetest.get_modpath("main").."/drops.lua")
|
||||
dofile(minetest.get_modpath("main").."/inv.lua")
|
||||
dofile(minetest.get_modpath("main").."/sprint.lua")
|
||||
dofile(minetest.get_modpath("main").."/item_pickup.lua")
|
||||
dofile(minetest.get_modpath("main").."/kill_fall.lua")
|
14
mods/main/kill_fall.lua
Normal file
14
mods/main/kill_fall.lua
Normal file
@ -0,0 +1,14 @@
|
||||
local checkstep = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
if checkstep <= 5 then
|
||||
checkstep = checkstep + dtime
|
||||
else
|
||||
checkstep = 0
|
||||
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
if player:get_pos().y < 1 then
|
||||
player:set_hp(0, {reason = "set_hp"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
Loading…
x
Reference in New Issue
Block a user