There's no player in a periodical event

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

Aawqq2112

Member
Apr 1, 2021
20
0
1
32
What's wrong with the script? I'm just a beginner and I can't figure it out
Code:
every 2 seconds in "world":
    player is the owner of the region "cafe"
    give player 1 stone
The error
"There's no player in a periodical event Cbiz. sk, line 3: give
player 1 stone'"
 
There is indeed no player in such an event. In a command there is for example. The one executing the command. There is no one executing a every x seconds skript.

Use looping all players, and then loop-player instead. Now there are players in the event becouse you looped all players in the server.
Code:
every 2 seconds in "world":
    loop all players:
        loop-player is the owner of the region "cafe"
        give 1 stone to loop-player
 
Code:
every 2 seconds in "world":
    loop all players:
        loop-player is the owner of the region "cafe"
        remove 20$ from loop-player's balance

I still have a question, I added another action to give the player money, and I got an error,
"20$ can't be removed from the money of loop-player
because the former is neither a money nor a number Cbiz. sk,
line 4: remove 20$ from loop-player's balance'
 
Status
Not open for further replies.