View difference between Paste ID: V2EyY8Sz and RkckztZK
SHOW: | | - or go back to the newest paste.
1
command /st [<text>] [<text>]:
2
    trigger:
3
        if player has permission "stattrak.admin":
4
            if arg-1 is "add":
5-
                set {_lore::*} to lore of player's tool split at "||"
5+
                set {_lore1::*} to lore of player's tool split at "||"
6-
                set {_loresize} to size of {_lore::*}
6+
                set line {_loresize1} + 1 of player's tool's lore to "&f『&aStatTrak : &f0』"
7-
                set line {_loresize} + 1 of player's tool's lore to "&f『&a&lStatTrak : &f0』"
7+
                send "&aStatTrak &fhas added to your hand item!"
8-
                send "&a&lStatTrak &fhas added to your hand item!"
8+
9
            if arg-1 is "del": 
10
                set {_loredetect1::*} to lore of player's tool split at "||"
11-
                set {_loredetect::*} to lore of player's tool split at "||"
11+
                loop {_loredetect1::*}:
12-
                loop {_loredetect::*}:
12+
                    {_loredetect1::%loop-index%} contains "&aStatTrack :":
13-
                    {_loredetect::%loop-index%} contains "&a&lStatTrak :":
13+
                        set {_linenumber1} to loop-index parsed as number
14-
                        set {_linenumber} to loop-index parsed as number
14+
                        delete line {_linenumber1} of player's tool's lore
15-
                        delete line {_linenumber} of player's tool's lore
15+
                        send "&aStatTrak &fhas removed from your hand item!"
16-
                        send "&a&lStatTrak &fhas removed from your hand item!"
16+
17
        if player has permission "stattrak.reset":
18
            if arg-1 is "r":
19
                set {_loredetect1::*} to lore of player's tool split at "||"
20-
                set {_loredetect::*} to lore of player's tool split at "||"
20+
                loop {_loredetect1::*}:
21-
                loop {_loredetect::*}:
21+
                    if {_loredetect1::%loop-index%} contains "&aStatTrack":
22-
                    if {_loredetect::%loop-index%} contains "&a&lStatTrak":
22+
                        set {_linenumber1} to loop-index parsed as number
23-
                        set {_linenumber} to loop-index parsed as number
23+
                        set line {_linenumber1} of player's tool's lore to "&f『&aStatTrak : &f0』"
24-
                        set line {_linenumber} of player's tool's lore to "&f『&a&lStatTrak : &f0』"
24+
                        send "&aStatTrak &fhas reset your hand item!"
25-
                        send "&a&lStatTrak &fhas reset your hand item!"
25+
26
on death of player:
27
    set {_loredetect1::*} to lore of attacker's tool split at "||"
28-
    set {_loredetect::*} to lore of attacker's tool split at "||"
28+
    loop {_loredetect1::*}:
29-
    loop {_loredetect::*}:
29+
        {_loredetect1::%loop-index%} contains "&aStatTrak :":
30-
        {_loredetect::%loop-index%} contains "&a&lStatTrak :":
30+
            replace all "&f『&aStatTrak : &f" with "" in {_loredetect1::%loop-index%}
31-
            replace all "&f『&a&lStatTrak : &f" with "" in {_loredetect::%loop-index%}
31+
            replace all "』" with "" in {_loredetect1::%loop-index%}
32-
            replace all "』" with "" in {_loredetect::%loop-index%}
32+
            set {_StatTrak.Num.Add} to {_loredetect1::%loop-index%} parsed as integer
33-
            set {_StatTrak.Num.Add} to {_loredetect::%loop-index%} parsed as integer
33+
34
            set {_linenumber1} to loop-index parsed as number
35-
            set {_linenumber} to loop-index parsed as number
35+
            set line {_linenumber1} of attacker's tool's lore to "&f『&aStatTrak : &f%{_StatTrak.Num.Add}%』"
36-
            set line {_linenumber} of attacker's tool's lore to "&f『&a&lStatTrak : &f%{_StatTrak.Num.Add}%』"
36+