1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AFK Rewards

Discussion in 'Skript' started by IViddyy, Jul 3, 2022.

Thread Status:
Not open for further replies.
  1. IViddyy

    IViddyy Member

    Joined:
    Apr 17, 2022
    Messages:
    14
    Likes Received:
    1
    Hi im trying to make afk rewards using worldguard but i cant figure it out can someone help me?
     
  2. Bit

    Bit Member

    Joined:
    Jan 26, 2021
    Messages:
    27
    Likes Received:
    0
    Do you mean literally afk or just going around in a specified area?
     
  3. MiiTsY

    MiiTsY Member

    Joined:
    May 27, 2022
    Messages:
    41
    Likes Received:
    1
    Code (Text):
    1. every 1 minute:
    2.     if "%region at player%" is "region name":
    3.         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 (Text):
    1. every 1 second:
    2.     loop all players:
    3.         if {counter.%loop-player's uuid%} is not set:
    4.             set {counter.%loop-player's uuid%} to 0
    5.         if "%region at loop-player%" is "lowlyzombies in world world":
    6.             add 1 to {counter.%loop-player's uuid%}
    7.             if {counter.%loop-player's uuid%}>= 60:
    8.                 set {counter.%loop-player's uuid%} to 0
    9.                 send "hi" to loop-player
    10.         else:
    11.             set {counter.%loop-player's uuid%} to 0
    12.  
     
    #3 MiiTsY, Jul 21, 2022
    Last edited: Jul 21, 2022
Thread Status:
Not open for further replies.

Share This Page

Loading...