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.

Problem with dropping item..

Discussion in 'Skript' started by HSW, May 3, 2020.

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

    HSW Member

    Joined:
    May 3, 2020
    Messages:
    4
    Likes Received:
    0
    Code (Text):
    1. on load:
    2.     add location at 34.5, 66, 95.5 in world "bedwars" to {bedwars.location.mineral::*}
    3.  
    4. #I am skipping this part...
    5.  
    6. every 1 second:
    7.     loop all items location at 34.5, 66, 95.5 in world "bedwars":
    8.         add 1 to {_cnt}
    9.     if {_cnt} isn't more than 64:
    10.         drop 1 iron ingot at {bedwars.location.mineral::*} without velocity
    This is part of my code. I have two problem..
    1. console error : Can't understand this loop: 'loop all items location at 34.5, 66, 95.5 in world "bedwars"' (test.sk, line 7: loop all items location at 34.5, 66, 95.5 in world "bedwars":')
    2. Items are not dropping!!

    What should I do? I've been working on this for five days.
    (Sorry for bed, I mean bad english...)
     
  2. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    711
    Likes Received:
    31
    Try write at location instead of location at. Or, change the loop to:
    Code (Skript):
    1. loop all items in world "bedwars":
     
    • Agree Agree x 1
  3. HSW

    HSW Member

    Joined:
    May 3, 2020
    Messages:
    4
    Likes Received:
    0
    So I change loop to:
    Code (Text):
    1. loop all items in world "bedwars":
    I thought this should work, of course. but....
    Console error: Can't understand this loop: 'loop all items in world "bedwars"' (test.sk, line 7: loop all items in world "bedwars":')
     
  4. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    711
    Likes Received:
    31
    Then, try:
    Code (Skript):
    1.  
    2. loop all dropped items in world "bedwars":
     
  5. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    665
    Likes Received:
    44
    First off all:

    Code (Text):
    1. loop all items location at 34.5, 66, 95.5 in world "bedwars":
    yes loop items at a location but at what radius?

    Code (Text):
    1. loop all items at location 34.5, 66, 95.5 in world "bedwars" in radius 10:
    Secondly:

    Code (Text):
    1. drop 1 iron ingot at {bedwars.location.mineral::*} without velocity
    It should work but i think its having trouble with the list.
    idk what ur intention is but:

    Code (Text):
    1. drop 1 iron ingot at random element out of {bedwars.location.mineral::*} without velocity
    Code (Text):
    1.  
    2. loop {bedwars.location.mineral::*}:
    3.    drop 1 iron ingot at loop-value without velocity
     
  6. HSW

    HSW Member

    Joined:
    May 3, 2020
    Messages:
    4
    Likes Received:
    0
    Ok I gave up the loop in radius thing...
    But...
    Code (Text):
    1.     loop {bedwars.location.mineral::*}:
    2.         drop 1 iron ore at loop-value without velocity
    I did this... and console doesn't output this error.
    But It's still not working...
     
  7. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    665
    Likes Received:
    44
    then the values in {bedwars.location.mineral::*} must be wrong can u send how u set these values
     
  8. KasiaPRO

    KasiaPRO Member

    Joined:
    May 2, 2020
    Messages:
    25
    Likes Received:
    0
    and what if you do this
    Code (Text):
    1. every 5 seconds:
    2.     loop all players:
    3.         loop all blocks in radius 5 around loop-player:
    4.             if loop-block is iron block:
    5.                 drop a iron ingot at loop-block's position
    6.  
     
  9. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    665
    Likes Received:
    44
    So when u have 100 people on ur entite server will lag :emoji_laughing:
     
    • Agree Agree x 1
  10. KasiaPRO

    KasiaPRO Member

    Joined:
    May 2, 2020
    Messages:
    25
    Likes Received:
    0
    probably XD
     
  11. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    665
    Likes Received:
    44
    To give u some stats:

    every 5 seconds
    100 players
    216 blocks * 100 = 21600 blocks
    21600 iron block checks
    ? iron spawns

    5 * 20 = 100 ticks

    21600 / 100 = 216

    216 block checks a game tick
     
  12. KasiaPRO

    KasiaPRO Member

    Joined:
    May 2, 2020
    Messages:
    25
    Likes Received:
    0
    But the players will need to be at 5 blocks radius, no?
     
  13. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    665
    Likes Received:
    44
    yeah sry i meant a ? instead of !. But its not about the iron spawn its about these 216 checks a game tick wich will get resource intensive
     
  14. KasiaPRO

    KasiaPRO Member

    Joined:
    May 2, 2020
    Messages:
    25
    Likes Received:
    0
    Ok, now i understand it
     
Thread Status:
Not open for further replies.

Share This Page

Loading...