Solved 'add 1 stone to {_x::*}' = stone, stone and stone ??

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

danielzinh

Member
Aug 1, 2019
13
0
1
25
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:
command /add:
    trigger:
        add 1 stone to {testvar::*}
command /viewvar:
    trigger:
        send "%{testvar::*}%"
 

Attachments

  • Capturar.PNG
    Capturar.PNG
    1.4 KB · Views: 145
Untested.
code_language.skript:
command /addstone [<integer=1>]:
    trigger:
        loop {testvar::*}:
            if loop-value is stone:
                set {testvar::%loop-index%} to (item amount of loop-value) + arg 1 of stone
                stop
        add arg 1 of stone to {testvar::*}
 
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:
command /add:
    trigger:
        add 1 stone to {testvar::*}
command /viewvar:
    trigger:
        send "%{testvar::*}%"
Skript replaces 1 with just a single one not typing 1 stone but typing 2 stone will make it 2 stone
 
code_language.skript:
command /add:
    trigger:
        add 1 stone to {testvar::*}
        stop

command /testvar:
    trigger:
        loop {testvar::*}:
            sed "%loop-value%"
        stop
Hope this will help you.
 
Untested.
code_language.skript:
command /addstone [<integer=1>]:
    trigger:
        loop {testvar::*}:
            if loop-value is stone:
                set {testvar::%loop-index%} to (item amount of loop-value) + arg 1 of stone
                stop
        add arg 1 of stone to {testvar::*}

You can just add a limit check.

code_language.skript:
command /addstone [<integer=1>]:
    trigger:
        loop {testvar::*}:
            if loop-value is stone:
                set {_check} to (item amount of loop-value) + arg 1 of stone
                if {_check} > 64:
                   stop
                else:
                    set {testvar::%loop-index%} to {_check}
                    stop
        add arg 1 of stone to {testvar::*}
 
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.
 
Status
Not open for further replies.