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 'add 1 stone to {_x::*}' = stone, stone and stone ??

Discussion in 'Skript' started by danielzinh, Apr 24, 2020.

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

    danielzinh Member

    Joined:
    Aug 1, 2019
    Messages:
    13
    Likes Received:
    0
    hi, I've tried everything, but I can't ... I created a code that by adding 'add 1 stone to {_x :: *}', the result is "stone, stone and stone", I wanted them to be together , something like "3 stones", how can I do it?


    code:
    Code (Text):
    1. command /add:
    2.     trigger:
    3.         add 1 stone to {testvar::*}
    4. command /viewvar:
    5.     trigger:
    6.         send "%{testvar::*}%"


     

    Attached Files:

  2. Best Answer:
    Post #6 by MPGxxYT, Apr 25, 2020
  3. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    243
    Likes Received:
    21
    Untested.
    Code (Skript):
    1.  
    2. command /addstone [<integer=1>]:
    3.     trigger:
    4.         loop {testvar::*}:
    5.             if loop-value is stone:
    6.                 set {testvar::%loop-index%} to (item amount of loop-value) + arg 1 of stone
    7.                 stop
    8.         add arg 1 of stone to {testvar::*}
     
  4. danielzinh

    danielzinh Member

    Joined:
    Aug 1, 2019
    Messages:
    13
    Likes Received:
    0
  5. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    Skript replaces 1 with just a single one not typing 1 stone but typing 2 stone will make it 2 stone
     
  6. blackid512

    blackid512 Member

    Joined:
    May 8, 2017
    Messages:
    23
    Likes Received:
    0
    Code (Skript):
    1.  
    2. command /add:
    3.     trigger:
    4.         add 1 stone to {testvar::*}
    5.         stop
    6.  
    7. command /testvar:
    8.     trigger:
    9.         loop {testvar::*}:
    10.             sed "%loop-value%"
    11.         stop
    12.  
    Hope this will help you.
     
  7. MPGxxYT

    MPGxxYT Member

    Joined:
    Feb 14, 2018
    Messages:
    10
    Likes Received:
    0
    You can just add a limit check.

    Code (Skript):
    1.  
    2. command /addstone [<integer=1>]:
    3.     trigger:
    4.         loop {testvar::*}:
    5.             if loop-value is stone:
    6.                 set {_check} to (item amount of loop-value) + arg 1 of stone
    7.                 if {_check} > 64:
    8.                    stop
    9.                 else:
    10.                     set {testvar::%loop-index%} to {_check}
    11.                     stop
    12.         add arg 1 of stone to {testvar::*}
     
  8. danielzinh

    danielzinh Member

    Joined:
    Aug 1, 2019
    Messages:
    13
    Likes Received:
    0
    Thanks guys, i found a solution. If the variable (example) has 512 stones, i will make this: 512 / 64 = 8, loop 8 times, 8 different format slots.
     
  9. MPGxxYT

    MPGxxYT Member

    Joined:
    Feb 14, 2018
    Messages:
    10
    Likes Received:
    0
    mark as solved
     
Thread Status:
Not open for further replies.

Share This Page

Loading...