This code for some reason pops up with no errors, yet simply does not work. I know that the problem is line 4, but I don't know what the problem with line 4 is.
I am using the latest version of Skript (2.12.2), and the latest version of SkBee. I use worldguard as my region plugin.
(I did try debugging this myself before I posted it here.)
Any help would be very much appreciated. Thank you.
I am using the latest version of Skript (2.12.2), and the latest version of SkBee. I use worldguard as my region plugin.
code_language.skript:
on enter of region "afk":
send "&aYou have entered the AFK zone!" to player
set {_afktime} to 0
while player's location is in event-region: # problem child
wait 1 second
add 1 to {_afktime}
send title "&a&lAFK" with subtitle "&7AFK TIME: &d%{_afktime}% &7seconds!" to player with fadein 0 seconds
if mod({_afktime}, 300) = 0:
add 6 to player's balance
send action bar "&aYou have received &d6☽&a for being AFK for &d%{_afktime}% seconds!" to player
chance of 1%:
add 30 to player's balance
send "&aYou have received a &dbonus &aof &d30☽&a!" to player
stop
on exit of region "afk":
send "&cYou have exited the AFK zone!" to player
(I did try debugging this myself before I posted it here.)
Any help would be very much appreciated. Thank you.