Jump to content

hi! i have a problem with my afk pool skript! here is the skript it says


DariusMihai

Recommended Posts

on load:
    set {item} to green candle of unbreaking named "&a&lᴀꜰᴋ ᴛᴏᴋᴇɴ"


every 5 minutes:
    loop all players:
        if "%region at loop-player%" contains "afk":
            give green candle of unbreaking named "&a&lᴀꜰᴋ ᴛᴏᴋᴇɴ" to player 
            send "&dYou got a &b AFK TOKEN &dfor being AFK!" to loop-player
            broadcast ""
            broadcast "&5All players in the AFK pit just got &5a&b AFK TOKEN!"
            broadcast ""
on leave of region "afk":
    send "&7&oYou left the AFK Area." to player 
    send "&7&oYou will no longer receive rewards every 10 minutes." to player 
    set {afk::%player's uuid%} to false
on enter of region "afk":
    push player forward at speed 1
    send "&7&oYou entered the AFK Area." to player 
    send "&7&oYou will receive &a&onice&7&o rewards every 10 minutes!" to player 
    set {afk::%player's uuid%} to true

sk error.png

if you guys can please help me fix the error

Link to comment
Share on other sites

As the person before me said, you need to use 'loop-player' instead of 'player', because there is no player in a periodical, or timed, event.
Your fixed section of code should look like this:

every 5 minutes:
    loop all players:
        if "%region at loop-player%" contains "afk":
            give green candle of unbreaking named "&a&lᴀꜰᴋ ᴛᴏᴋᴇɴ" to loop-player 
            send "&dYou got a &b AFK TOKEN &dfor being AFK!" to loop-player
            broadcast ""
            broadcast "&5All players in the AFK pit just got &5a&b AFK TOKEN!"
            broadcast ""

 

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...