My code isnt working for some reason

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

Poinapples

Member
Feb 4, 2024
21
0
1
13
code_language.skript:
on right click with 1 red dye:
    if name of tool of player is "&4Strength":
        if {team.%player%} is 4:
            if {strength.%player%} is 0:
                execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 2"
                add 1 to {strength_number.%player's uuid%}
                remove 1 red dye from player
            if {strength.%player's uuid%} is 1:
                execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 3"
                add 1 to {strength_number.%player's uuid%}
                remove 1 red dye from player
            if {strength.%player's uuid%} is 2:
                execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 4"
                add 1 to {strength_number.%player's uuid%}
                remove 1 red dye from player
            if {strength.%player's uuid%} is 3:
                execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 5"
                add 1 to {strength_number.%player's uuid%}
                remove 1 red dye from player
            if {strength.%player's uuid%} is 4:
                execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 6"
                add 1 to {strength_number.%player's uuid%}
                remove 1 red dye from player
Im trying to make it so that when you right click the red dye, you gain 1 attack damage, but it doesnt work and it doesnt havae any errors in Skript.
 
You could try changing the beginning of the script to
Code:
on right click:
    if player's tool is red dye named "&4Strength":
 
try this
Code:
on right click:
    if event-item is red dye:
        if name of event-item is "&4Strength":
            if {team.%player%} is 4:
                if {strength.%player%} is 0:
                    execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 2"
                    add 1 to {strength_number.%player's uuid%}
                    remove 1 red dye from player
                if {strength.%player's uuid%} is 1:
                    execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 3"
                    add 1 to {strength_number.%player's uuid%}
                    remove 1 red dye from player
                if {strength.%player's uuid%} is 2:
                    execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 4"
                    add 1 to {strength_number.%player's uuid%}
                    remove 1 red dye from player
                if {strength.%player's uuid%} is 3:
                    execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 5"
                    add 1 to {strength_number.%player's uuid%}
                    remove 1 red dye from player
                if {strength.%player's uuid%} is 4:
                    execute console command "/attribute %player's uuid% minecraft:generic.attack_damage base set 6"
                    add 1 to {strength_number.%player's uuid%}
                    remove 1 red dye named "&4Strength" from player
 
JavaScript:
options:
    strength-item: 1 red dye named "&4Strength"

on right click with red dye:
    if 1 of event-item = {@strength-item}:
        if {team::%uuid of player%} = 4:
            if generic attack damage attribute of player < 6:
                remove 1 of event-item from player
                set generic attack damage attribute of player to (generic attack damage attribute of player + 1)
changed {team.%player%} to {team::%uuid of player%}
 
None of these worked for some reason. I even made another skript to check and it didnt work. When I right click with the item, it doesn't go away.