From ba3f3e0532a6e9588055f6b6028c5e7ca506a441 Mon Sep 17 00:00:00 2001 From: kaadmy Date: Thu, 1 Oct 2015 16:27:22 -0700 Subject: [PATCH] players that go outside of 30000m now get killed --- mods/default/player.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/default/player.lua b/mods/default/player.lua index 5e8ad6f..9da8991 100644 --- a/mods/default/player.lua +++ b/mods/default/player.lua @@ -3,10 +3,17 @@ local player_lastsound = {} local player_health = {} local function step(dtime) - for _,player in ipairs(minetest.get_connected_players()) do + for _, player in ipairs(minetest.get_connected_players()) do local player_pos=player:getpos() local name=player:get_player_name() + if player_pos.x < -30000 or player_pos.x > 30000 + or player_pos.y < -30000 or player_pos.y > 30000 + or player_pos.z < -30000 or player_pos.z > 30000 then + minetest.chat_send_player(name, "Don't go past 30000m in any direction!") + player.set_hp(0) + end + if player:get_hp() < player_health[name] then minetest.sound_play( "default_hurt",