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.

Solved There's no a player in a periodical event

Discussion in 'Skript' started by Aztron, Mar 22, 2017.

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

    Aztron New Member

    Joined:
    Mar 15, 2017
    Messages:
    7
    Likes Received:
    0
    I want to create a Personal generator, like EggWars.
    with a button to turn on/off.
    I created " {spawn.%player%} " to turn on and off spawn (summon) items.
    Errors on Reload:
    Code (Skript):
    1. There's no a player in a periodical event.


    Code:
    Code (Skript):
    1. every 5 seconds in "world":
    2.   if {spawn.%player%} is true:
    3.     if {level1.%player%} is true:
    4.       make console execute command "summon Item %{x1}% %{y1}% %{z1}% {Item:{id:264,Count:5,tag:{display:{Name:""&bDiamond"",Lore:[Diamonds & more Diamonds!]}}}}"
    5.     else if {level2.%player%} is true:
    6.       make console execute command "summon Item %{x1}% %{y1}% %{z1}% {Item:{id:264,Count:8,tag:{display:{Name:""&bDiamond"",Lore:[Diamonds & more Diamonds!]}}}}"
    7.     else:
    8.       make console execute command "summon Item %{x1}% %{y1}% %{z1}% {Item:{id:264,Count:2,tag:{display:{Name:""&bDiamond"",Lore:[Diamonds & more Diamonds!]}}}}"
    9.  
     
    #1 Aztron, Mar 22, 2017
    Last edited: Mar 22, 2017
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    You can't use "%player%" because you aren't executing it every 5 seconds. You'd have to loop all the players first.


    Code (Skript):
    1.  
    2. every 5 seconds:
    3.     loop all players:
    4.         if loop-player is in world "world":
    5.             if {spawn.%loop-player%} is true:
    6.                 if {level1.%loop-player%} is true:
    7.                     console command "summon Item %{x1}% %{y1}% %{z1}% {Item:{id:264,Count:5,tag:{display:{Name:""&bDiamond"",Lore:[Diamonds & more Diamonds!]}}}}"
    8.                 else if {level2.%loop-player%} is true:
    9.                     console command "summon Item %{x1}% %{y1}% %{z1}% {Item:{id:264,Count:8,tag:{display:{Name:""&bDiamond"",Lore:[Diamonds & more Diamonds!]}}}}"
    10.                 else:
    11.                     console command "summon Item %{x1}% %{y1}% %{z1}% {Item:{id:264,Count:2,tag:{display:{Name:""&bDiamond"",Lore:[Diamonds & more Diamonds!]}}}}"
    12.  
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    It works:emoji_slight_smile:.
    Thanks for the help buddy.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...