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.

loop items from GUI and add only items to list variable, not air

Discussion in 'Skript' started by Ubya, Jun 16, 2020.

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

    Ubya Member

    Joined:
    Jun 15, 2020
    Messages:
    10
    Likes Received:
    0
    i've been trying to find a solution for a few hours now, and i can't find anything.
    this is the part that generates the list variable from the GUI inventory
    Code (Text):
    1. loop 54 times:
    2.             set {_loop} to loop-value - 1
    3.             set {bingo.%{_loop}%} to slot {_loop} of player's current inventory
    while this picks 30 random items from that list and shows them to the player in chat.
    Code (Text):
    1. loop all players in world "Bingo":
    2.             loop 30 times:
    3.                 set {_random} to a random integer between 0 and 53
    4.                 add {bingo.%{_random}%} to {bingo.%loop-player%::*}
    5.             send "%{bingo.%loop-player%::*}%" to loop-player
    issue is, it also saves and then shows air, while i want only items, how can i say to save only slots without air? or in the second part of the code how do i set it so that if {bingo.%{_random}%} is air to pick another?
     
  2. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    For the million (th?) i say to do not hardcode :|
     
  3. Ubya

    Ubya Member

    Joined:
    Jun 15, 2020
    Messages:
    10
    Likes Received:
    0
    hardcore?
    yes that must be the issue i'm having, because i wrote the name of the world instead of a variable i can change ingame
     
Thread Status:
Not open for further replies.

Share This Page

Loading...