Well for some reason my code just makes the server crash when someone comes back from being afk. I have no idea why.
Here is my code:
Any help I can get would be appreciated.
- Narpzy
[doublepost=1578231628,1578230635][/doublepost]it usually crashes after long periods of time
Here is my code:
Code:
command /setlimbo:
permission: admin
trigger:
set {limbo} to location of player
send "&eYou set the Limbo spawn to your current location!"
on any move:
if {afk.%player%} is true:
loop all blocks in radius 2 around player:
loop-block is water or piston or sticky_piston:
stop
loop all players in radius 2 around player:
loop-player is not "%player%":
stop
loop all animals in radius 2 around player:
loop-animal is set:
stop
teleport player to {hub}
set {afk.%player%} to false
delete {auto%player%}
every 1 seconds:
loop all players:
add 1 to {auto%loop-player%}
wait 1 tick
if {auto%loop-player%} is more than 294:
if {afk.%loop-player%} is true:
stop
else:
teleport loop-player to {limbo}
loop 10 times:
send "&c" to loop-player
send "&cYou became AFK and got sent to the limbo." to loop-player
wait 4 seconds
set {afk.%loop-player%} to true
stop
- Narpzy
[doublepost=1578231628,1578230635][/doublepost]it usually crashes after long periods of time