Solved Loop help

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

Status
Not open for further replies.

ItzarReal

Member
Oct 21, 2020
19
0
1
So I'm making a koth (king of the hill) plugin and I cant figure out how to loop if the player is on a gold block. Here's my code:
Code:
on step on gold block:
    every 10 seconds:
        add 10 to balance of player
 
Last edited:
You could use something similar to this

Code:
every 10 seconds:
    if block under player is gold block:
        add 10 to player's balance
This wouldn't work because there's no player in a periodical event.


Why are you adding balance every 10 seconds? Why not $1 a second?

My code is:

Code:
Every 10 seconds:
    loop all players:
        if block under loop-player is gold block:
            #code
 
Loop all players, and then check for the loop player, apologies
im making it give money every ten seconds so they have to work harder to get the money
[doublepost=1605113429,1605113320][/doublepost]
Loop all players, and then check for the loop player, apologies
so like this?
Code:
Every 10 seconds:
    loop all players:
        if block under loop-player is gold block:
           add 10 to %loop-player% balance
 
im making it give money every ten seconds so they have to work harder to get the money
[doublepost=1605113429,1605113320][/doublepost]
so like this?
Code:
Every 10 seconds:
    loop all players:
        if block under loop-player is gold block:
           add 10 to %loop-player% balance
Indeed that looks okay to me:emoji_slight_smile:
 
Status
Not open for further replies.