Afk Rewards

  • 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 community!

    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!

__LEEIF__

New Member
Dec 13, 2023
8
0
1
I need help with my skript I am trying to make a skript that gives players a token every 3 minutes if they do /afk but it's giving everyone the tokens and I can't figure out why
This Is The Skript:

command /afk:
trigger:
send "&2You Are Now Afk" to player
set {afk::%player%} to true
if {afk::%player%} is true:
set {afk::%player%} to false
if {afk::%player%} is false:
set {afk::%player%} to true

every 3 minutes:
if {afk::%player%} is true:
give loop-player red dye named "&4Afk&5Token"

On player move:
if {afk::%player%} is true:
set {afk::%player%} to false

on chat:
if {afk::%player%} is true:
set {afk::%player%} to false
 
I need help with my skript I am trying to make a skript that gives players a token every 3 minutes if they do /afk but it's giving everyone the tokens and I can't figure out why
This Is The Skript:

command /afk:
trigger:
send "&2You Are Now Afk" to player
set {afk::%player%} to true
if {afk::%player%} is true:
set {afk::%player%} to false
if {afk::%player%} is false:
set {afk::%player%} to true

every 3 minutes:
if {afk::%player%} is true:
give loop-player red dye named "&4Afk&5Token"

On player move:
if {afk::%player%} is true:
set {afk::%player%} to false

on chat:
if {afk::%player%} is true:
set {afk::%player%} to false
so let's just go by ur code real quick.

The player does /afk while afk is false
it set's afk to true
checks if it's true
sets afk to false if it is
checks if afk is false
sets afk to true in any way, as it was set to false if it was true before

learn what 'else if' means
 
I need help with my skript I am trying to make a skript that gives players a token every 3 minutes if they do /afk but it's giving everyone the tokens and I can't figure out why
This Is The Skript:

command /afk:
trigger:
send "&2You Are Now Afk" to player
set {afk::%player%} to true
if {afk::%player%} is true:
set {afk::%player%} to false
if {afk::%player%} is false:
set {afk::%player%} to true

every 3 minutes:
if {afk::%player%} is true:
give loop-player red dye named "&4Afk&5Token"

On player move:
if {afk::%player%} is true:
set {afk::%player%} to false

on chat:
if {afk::%player%} is true:
set {afk::%player%} to false
Code:
command /afk:
    trigger:
        send "&2You Are Now Afk" to player
        set {afk::%player%} to true
        if {afk::%player%} is true:
            set {afk::%player%} to false
        if {afk::%player%} is false:
            set {afk::%player%} to true

every 3 minutes:
    loop all players:
        if {afk::%loop-player%} is true:
            give red dye named "&4Afk&5Token" to loop-player

On player move:
    if {afk::%player%} is true:
        set {afk::%player%} to false
        send "&cYou moved" to player

on chat:
    if {afk::%player%} is true:
        set {afk::%player%} to false
 
Last edited:
Code:
command /afk:
    trigger:
        send "&2You Are Now Afk" to player
        set {afk::%player%} to true
        if {afk::%player%} is true:
            set {afk::%player%} to false
        if {afk::%player%} is false:
            set {afk::%player%} to true

every 3 minutes:
    loop all players:
        if {afk::%loop-player%} is true:
            give red dye named "&4Afk&5Token" to loop-player

On player move:
    if {afk::%player%} is true:
        set {afk::%player%} to false
        send "&cYou moved" to player

on chat:
    if {afk::%player%} is true:
        set {afk::%player%} to false
alright just ignore my response when spoonfeeding him code
 
Code:
command /afk:
    trigger:
        send "&2You Are Now Afk" to player
        set {afk::%player%} to true
        if {afk::%player%} is true:
            set {afk::%player%} to false
        if {afk::%player%} is false:
            set {afk::%player%} to true

every 3 minutes:
    loop all players:
        if {afk::%loop-player%} is true:
            give red dye named "&4Afk&5Token" to loop-player

On player move:
    if {afk::%player%} is true:
        set {afk::%player%} to false
        send "&cYou moved" to player

on chat:
    if {afk::%player%} is true:
        set {afk::%player%} to false
this worked ty