ChisleLP

  • 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 community!

    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.

WiebeHero

Active Member
Aug 23, 2017
135
5
0
So, hey chisleLP thanks for the help on my last thread! But now i am in need of youre help again...
And i couldnt start a conversation with you so here we go.
The problem is that when i combined a 1 / 2 with a 0 / 2 it set itself to 1 / 4 but it should be 0 / 4.
Can you or anyone help me with this?:
Code:
on inventory click:
    cursor slot of player is stone hoe
    lore of cursor slot of player contains "&7Upgrade Progress: "
    lore of clicked item contains "&7Upgrade Progress: "
    cancel event
    set {_I::*} to lore of clicked item split at "||"
    set {_L::*} to lore of cursor slot of player split at "||"
    loop {_I::*}:
        if "%loop-value%" contains "&7Upgrade Progress: ":
            set {_t} to loop-index parsed as integer
            stop loop
    loop {_L::*}:
        if "%loop-value%" contains "&7Upgrade Progress: ":
            set {_s} to loop-index       
            stop loop
    set {_L} to "%uncolored {_L::%{_s}%}%"
    set {_I} to "%uncolored {_I::%{_t}%}%"
    replace every "Upgrade Progress: " with "" in {_L}
    replace every "Upgrade Progress: " with "" in {_I}
    replace every " " with "" in {_L}
    replace every " " with "" in {_I}
    set {_B::*} to {_I} split at "/"
    set {_A::*} to {_L} split at "/"
    set {_N} to {_A::1} parsed as number
    set {_M} to {_A::2} parsed as number
    set {_O} to {_B::1} parsed as number
    set {_P} to {_B::2} parsed as number
    {_n} is 0
    {_m} is 2
    set cursor of player to air
    add 1 to {_o}
    if {_o} is equal to {_p}:
        send "&aYou have just &eUpgraded &aYoure Weapon! "
        remove clicked item from player's inventory
        if {_p} is 2:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:10.0,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.6,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 2]" with lore "&7Confusion II||&7---------------------||&7Attack Damage: 10||&7Attack Speed: 0.4||&7---------------------||&7Upgrade Progress: 0 / 4||&7Rarity: Common"
        else if {_p} is 4:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:8.5,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.4,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 3]" with lore "&7Confusion III||&7---------------------||&7Attack Damage: 8.5||&7Attack Speed: 0.6||&7---------------------||&7Upgrade Progress: 0 / 10||&7Rarity: Common"
        else if {_p} is 10:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:10,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.4,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 4]" with lore "&7Confusion IV||&7Blast I||&7---------------------||&7Attack Damage: 10||&7Attack Speed: 0.6||&7---------------------||&7Upgrade Progress: 0 / 20||&7Rarity: Common"
        else if {_p} is 20:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:12,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.4,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 5]" with lore "&7Confusion IV||&7Blast II||&7---------------------||&7Attack Damage: 12||&7Attack Speed: 0.6||&7---------------------||&7Upgrade Progress: 0 / 50||&7Rarity: Common"
        else if {_p} is 50:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:9,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.2,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 6]" with lore "&7Confusion IV||&7Blast III||&7---------------------||&7Attack Damage: 9||&7Attack Speed: 0.8||&7---------------------||&7Upgrade Progress: 0 / 100||&7Rarity: Common"
        else if {_p} is 20:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:12,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.2,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 7]" with lore "&7Confusion IV||&7Blast IV||&7---------------------||&7Attack Damage: 12||&7Attack Speed: 0.8||&7---------------------||&7Upgrade Progress: MAX||&7Rarity: Common"
    else:
        set the {_t}th line of lore of clicked item to "&7Upgrade Progress: %{_o}% / %{_p}%"

command /item:
    trigger:
        loop 30 times:
            give player stone hoe named "SOLVED!" with lore "||||||||||&7Upgrade Progress: 0 / 2"
on inventory click:
    cursor slot of player is stone hoe
    lore of cursor slot of player contains "&7Upgrade Progress: "
    lore of clicked item contains "&7Upgrade Progress: "
    cancel event
    set {_I::*} to lore of clicked item split at "||"
    set {_L::*} to lore of cursor slot of player split at "||"
    loop {_I::*}:
        if "%loop-value%" contains "&7Upgrade Progress: ":
            set {_t} to loop-index parsed as integer
            stop loop
    loop {_L::*}:
        if "%loop-value%" contains "&7Upgrade Progress: ":
            set {_s} to loop-index       
            stop loop
    set {_L} to "%uncolored {_L::%{_s}%}%"
    set {_I} to "%uncolored {_I::%{_t}%}%"
    replace every "Upgrade Progress: " with "" in {_L}
    replace every "Upgrade Progress: " with "" in {_I}
    replace every " " with "" in {_L}
    replace every " " with "" in {_I}
    set {_B::*} to {_I} split at "/"
    set {_A::*} to {_L} split at "/"
    set {_N} to {_A::1} parsed as number
    set {_M} to {_A::2} parsed as number
    set {_O} to {_B::1} parsed as number
    set {_P} to {_B::2} parsed as number
    {_n} is 1
    {_m} is 2
    set cursor of player to air
    add 2 to {_o}
    if {_o} is more than or equal to {_p}:
        send "&aYou have just &eUpgraded &aYoure Weapon! "
        remove clicked item from player's inventory
        if {_p} is 2:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:10.0,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.6,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 2]" with lore "&7Confusion II||&7---------------------||&7Attack Damage: 10||&7Attack Speed: 0.4||&7---------------------||&7Upgrade Progress: 1 / 4||&7Rarity: Common"
        else if {_p} is 4:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:8.5,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.4,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 3]" with lore "&7Confusion III||&7---------------------||&7Attack Damage: 8.5||&7Attack Speed: 0.6||&7---------------------||&7Upgrade Progress: 1 / 10||&7Rarity: Common"
        else if {_p} is 10:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:10,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.4,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 4]" with lore "&7Confusion IV||&7Blast I||&7---------------------||&7Attack Damage: 10||&7Attack Speed: 0.6||&7---------------------||&7Upgrade Progress: 1 / 20||&7Rarity: Common"
        else if {_p} is 20:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:12,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.4,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 5]" with lore "&7Confusion IV||&7Blast II||&7---------------------||&7Attack Damage: 12||&7Attack Speed: 0.6||&7---------------------||&7Upgrade Progress: 1 / 50||&7Rarity: Common"
        else if {_p} is 50:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:9,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.2,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 6]" with lore "&7Confusion IV||&7Blast III||&7---------------------||&7Attack Damage: 9||&7Attack Speed: 0.8||&7---------------------||&7Upgrade Progress: 1 / 100||&7Rarity: Common"
        else if {_p} is 100:
            give player a unbreakable glowing stone hoe with nbt "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:12,Operation:0,UUIDLeast:324464,UUIDMost:154531,Slot:""mainhand""},{AttributeName:""generic.attackSpeed"",Name:""generic.attackSpeed"",Amount:-3.2,Operation:0,UUIDLeast:8055,UUIDMost:772149,Slot:""mainhand""}]}" named "&7Stone Club [Lv 7]" with lore "&7Confusion IV||&7Blast IV||&7---------------------||&7Attack Damage: 12||&7Attack Speed: 0.8||&7---------------------||&7Upgrade Progress: MAX||&7Rarity: Common"
    else:
        set the {_t}th line of lore of clicked item to "&7Upgrade Progress: %{_o}% / %{_p}%"
 
Status
Not open for further replies.