Skip to content

Instantly share code, notes, and snippets.

@cornernote
Created October 3, 2012 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cornernote/3824510 to your computer and use it in GitHub Desktop.
Save cornernote/3824510 to your computer and use it in GitHub Desktop.
bedrock - don't let players go below y=0
local bedrock_timer = 0
minetest.register_globalstep(function(dtime)
bedrock_timer = bedrock_timer + dtime
for k,player in ipairs(minetest.get_connected_players()) do
if bedrock_timer < 1 then return end
bedrock_timer = 0
local pos = player:getpos()
if pos.y < -1 then
player:setpos({x=pos.x,y=2,z=pos.z})
end
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment