From 0a926f429a8c57cdec9772906cb52952bbd5d7fd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 8 Sep 2020 21:05:07 +0200 Subject: [PATCH] Reduce random AFK offset to from 5 nodes to 1 node --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 81b18e8..fa03049 100644 --- a/init.lua +++ b/init.lua @@ -124,7 +124,9 @@ function teleports.teleportate(parameters) teleports.lastplayername = playername player:setpos({x=pos2.x,y=pos2.y+0.5,z=pos2.z}) else - player:setpos({x=pos2.x-5+math.random(1, 10),y=pos2.y+3,z=pos2.z-5+math.random(1, 10)}) + -- Small chance to "miss" destiation by 1 node horizontally to prevent afk players + -- from teleporting forever + player:setpos({x=pos2.x-2+math.random(1, 3),y=pos2.y+0.5,z=pos2.z-2+math.random(1, 3)}) end end end