hehe
This commit is contained in:
Robbie Ferguson 2016-05-18 15:10:23 -04:00
parent e2483592e5
commit 2f82b11d9c

@ -253,6 +253,19 @@ local function tpj(name,param)
end
end
-- Evade
local function tpe(name)
local negatives = { '-','' } -- either it's this way or that way
local isnegative = negatives[math.random(2)]
local distance = negatives .. math.random(4,15) -- the distance to jump
local times = math.random(3,6) -- how many times to jump - minimum,maximum
local options = { 'x', 'y', 'z' }
local axis = options[math.random(3)]
for i = 1,times do
minetest.after(1, tpj(axis,distance)) -- do this every 1 second
end
end
minetest.register_chatcommand("tpr", {
description = "Request teleport to another player",
params = "<playername> | leave playername empty to see help message",
@ -281,6 +294,12 @@ minetest.register_chatcommand("tpj", {
func = tpj
})
minetest.register_chatcommand("tpe", {
description = "Evade Enemy",
privs = {interact=true},
func = tpe
})
minetest.register_chatcommand("tpy", {
description = "Accept teleport requests from another player",
func = tpr_accept