mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2025-01-07 21:47:30 +01:00
Update init.lua
This commit is contained in:
parent
38982dadf2
commit
97437c3a80
9
init.lua
9
init.lua
@ -255,21 +255,20 @@ end
|
|||||||
|
|
||||||
-- Evade
|
-- Evade
|
||||||
local function tpe(player)
|
local function tpe(player)
|
||||||
local negatives = { '-','' } -- either it's this way or that way
|
|
||||||
local options = { 'x', 'y', 'z' }
|
|
||||||
local mindistance = 4
|
local mindistance = 4
|
||||||
local maxdistance = 15
|
local maxdistance = 15
|
||||||
|
local times = math.random(3,6) -- how many times to jump - minimum,maximum
|
||||||
|
local negatives = { '-','' } -- either it's this way or that way
|
||||||
|
local options = { 'x', 'y', 'z' }
|
||||||
local isnegative = ''
|
local isnegative = ''
|
||||||
local distance = 0
|
local distance = 0
|
||||||
local times = 0
|
|
||||||
local axis = ''
|
local axis = ''
|
||||||
for i = 1,times do
|
for i = 1,times do
|
||||||
-- do this every 1 second
|
-- do this every 1 second
|
||||||
minetest.after(1,
|
minetest.after(1,
|
||||||
function()
|
function()
|
||||||
isnegative = negatives[math.random(2)]
|
isnegative = negatives[math.random(2)] -- choose randomly whether this is this way or that
|
||||||
distance = isnegative .. math.random(mindistance,maxdistance) -- the distance to jump
|
distance = isnegative .. math.random(mindistance,maxdistance) -- the distance to jump
|
||||||
times = math.random(3,6) -- how many times to jump - minimum,maximum
|
|
||||||
axis = options[math.random(3)]
|
axis = options[math.random(3)]
|
||||||
tpj(axis,distance)
|
tpj(axis,distance)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user