Skill GUI issue

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

WiebeHero

Active Member
Aug 23, 2017
135
5
0
Hello i am WiebeHero and i got 2 issues with my code for a advanced tsuke GUI. Now the first one is that on the first click on the specific item works but after that is just adds 5 to {AttackL} wich it is not supposed to do. The second one is that i can only click it once and NOT twice. I want to make it that you can click it as much as you want but it doesnt work. Any ideas?
Code:
make gui 10 with iron sword named "&6Attack Damage" with lore "&7This will increase you're &6ATTACK DAMAGE &7that||&7You do to you're enemy!||&6Attack Damage Level: %{AttackL.%player%}% / 100||||&6Attack Damage: %{AttackD.%player%}% / 495%%":
                if gui-click-action is left mouse or right mouse button:
                    lore of gui-clicked-item contains "&6Attack Damage Level: "
                    lore of gui-clicked-item contains "&6Attack Damage: "
                    set {Attack.%player%::*} to lore of gui-clicked-item split at "||"
                    loop {Attack.%player%::*}:
                        if "%loop-value%" contains "&6Attack Damage Level: ":
                            set {LoreT.%player%} to loop-index parsed as integer
                            stop loop
                        if "%loop-value%" contains "&6Attack Damage: ":
                            set {LoreN.%player%} to loop-index parsed as integer
                            stop loop
                    set {Attack.%player%} to "%uncolored {Attack.%player%::%{LoreT.%player%}%}%"
                    set {Attack.%player%} to "%uncolored {Attack.%player%::%{LoreN.%player%}%}%"
                    replace every "Attack Damage Level: " with "" in {Attack.%player%}
                    replace every "Attack Damage: " with "" in {Attack.%player%}
                    replace every " " with "" in {Attack.%player%}
                    set {Max1.%player%::*} to {Attack.%player%} split at "/"
                    set {Max2.%player%::*} to {Attack.%player%} split at "/"
                    set {AttackL.%player%} to {Max1.%player%::1} parsed as number
                    set {AttackD.%player%} to {Max2.%player%::1} parsed as number
                    if {SkillPoints.%player%} is equal to 0:
                        message "&aYou do not have enough &6SKILL POINTS &aFor this!"
                    if {SkillPoints.%player%} is more than 0:
                        add 1 to {AttackL.%player%}
                        add 5 to {AttackD.%player%}
                        remove 1 from {SkillPoints.%player%}
                        make gui 10 with iron sword named "&6Attack Damage" with lore "&7This will increase you're &6ATTACK DAMAGE &7that||&7You do to you're enemy!||&6Attack Damage Level: %{AttackL.%player%}% / 100||||&6Attack Damage: %{AttackD.%player%}% / 495%%"
                        make gui 0 with book named "&6Skill Points" with lore "&7These are you're &6SKILL &7points that you||&7Can invest in custom abilities!||&6Skill Points: %{SkillPoints.%player%}%"
 
Status
Not open for further replies.