Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
HybridDog committed Aug 20, 2014
0 parents commit 6c940bc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
## Generic ignorable patterns and files
*~
.*.swp
debug.txt
22 changes: 22 additions & 0 deletions init.lua
@@ -0,0 +1,22 @@
local players = {}
local timer = 0

minetest.register_globalstep(function(dtime)
timer = timer + dtime
if timer >= 2 then
timer = 0
for _,p in pairs(minetest.get_connected_players()) do
local name = p:get_player_name()
local pos = p:getpos()
if math.abs(pos.x) <= 32000
and math.abs(pos.y) <= 32000
and math.abs(pos.z) <= 32000 then
players[name] = pos
else
local pos2 = players[name] or {x=0, y=20, z=0}
p:setpos(pos2)
minetest.chat_send_player(name, "You were too far away.")
end
end
end
end)

0 comments on commit 6c940bc

Please sign in to comment.