Created
October 3, 2012 03:11
-
-
Save cornernote/3824737 to your computer and use it in GitHub Desktop.
build bedrock under player
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local bedrock_timer = 1 | |
minetest.register_globalstep(function(dtime) | |
bedrock_timer = bedrock_timer - dtime | |
if bedrock_timer > 0 then return end | |
for k,player in ipairs(minetest.get_connected_players()) do | |
bedrock_timer = 1 | |
local pos = player:getpos() | |
if pos.y < -1 then | |
player:setpos({x=pos.x,y=3,z=pos.z}) | |
end | |
if (pos.y<2) then | |
if minetest.env:get_node({x=pos.x,y=-1,z=pos.z}).name == "air" then | |
for x=-2,2 do | |
for z=-2,2 do | |
minetest.env:set_node({x=pos.x+x,y=-1,z=pos.z+z}, {name="super_flat:bedrock"}) | |
end | |
end | |
end | |
end | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment