• Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

IViddyy

Member
Apr 17, 2022
17
1
3
Hi im trying to make afk rewards using worldguard but i cant figure it out can someone help me?
 
Code:
every 1 minute:
    if "%region at player%" is "region name":
        do your thing

If you want to check your region name you can put in the every 1 minute loop
broadcast "%region at player%" while you are standing in the region

This is a simple way but it has flaws, which is if he leaves and come back before the 1 min, it will still reward him, instead just make a counter to fix that

something like that


Code:
every 1 second:
    loop all players:
        if {counter.%loop-player's uuid%} is not set:
            set {counter.%loop-player's uuid%} to 0
        if "%region at loop-player%" is "lowlyzombies in world world":
            add 1 to {counter.%loop-player's uuid%}
            if {counter.%loop-player's uuid%}>= 60:
                set {counter.%loop-player's uuid%} to 0
                send "hi" to loop-player
        else:
            set {counter.%loop-player's uuid%} to 0
 
Last edited:
Status
Not open for further replies.