Strength Skript

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

brsko

Member
Mar 21, 2024
18
0
1
21
My skript works but when you try to hold over 1 in your hand it doesn't redeem but if you have 1 in your hand it redeems, please help.
Code:
on right click:
    if player is holding red dye named "&csᴛʀᴇɴɢᴛʜ &7(ʀɪɢʜᴛ ᴄʟɪᴄᴋ)" with lore "&cThis gives +1 attack damage, right click to reddem, you must be below +5 attack damage for this to work.":
        if {strength::%player's uuid%} is 5:
            send "{@prefix} &cYou already are at the maximum amount of strength." to player
        else:
            add 1 to {strength::%player's uuid%}
            send "{@prefix} &cYou have redeemed &4+1 &cattack damage." to player
            remove 1 red dye named "&csᴛʀᴇɴɢᴛʜ &7(ʀɪɢʜᴛ ᴄʟɪᴄᴋ)" with lore "&cThis gives +1 attack damage, right click to reddem, you must be below +5 attack damage for this to work." from player
Thanks - brsko.
 
My skript works but when you try to hold over 1 in your hand it doesn't redeem but if you have 1 in your hand it redeems, please help.
Code:
on right click:
    if player is holding red dye named "&csᴛʀᴇɴɢᴛʜ &7(ʀɪɢʜᴛ ᴄʟɪᴄᴋ)" with lore "&cThis gives +1 attack damage, right click to reddem, you must be below +5 attack damage for this to work.":
        if {strength::%player's uuid%} is 5:
            send "{@prefix} &cYou already are at the maximum amount of strength." to player
        else:
            add 1 to {strength::%player's uuid%}
            send "{@prefix} &cYou have redeemed &4+1 &cattack damage." to player
            remove 1 red dye named "&csᴛʀᴇɴɢᴛʜ &7(ʀɪɢʜᴛ ᴄʟɪᴄᴋ)" with lore "&cThis gives +1 attack damage, right click to reddem, you must be below +5 attack damage for this to work." from player
Thanks - brsko.
I didn’t read this carefully but it should be like loop amount of item in players hand
 
Try
Code:
if player's tool is 1 or more red dye named "&csᴛʀᴇɴɢᴛʜ &7(ʀɪɢʜᴛ ᴄʟɪᴄᴋ)" with lore "&cThis gives +1 attack damage, right click to reddem, you must be below +5 attack damage for this to work."
 
me when 1 of player's tool:
Screenshot 2024-01-17 201832.png
 
Try
Code:
if player's tool is 1 or more red dye named "&csᴛʀᴇɴɢᴛʜ &7(ʀɪɢʜᴛ ᴄʟɪᴄᴋ)" with lore "&cThis gives +1 attack damage, right click to reddem, you must be below +5 attack damage for this to work."
(you gotta use item amount of player's tool >= 1 instead of this, i got it wrong)
 
I recommend using a item saving skript, so you don't have those long lines that take forever to parse.
code_language.skript:
command saveitem <name:text>:
    trigger:
        set {items::%{_name}%} to player's tool
        send "Set %{_name}% to your tool" to player

then, you can do something like:
code_language.skript:
if player's tool is 1 of {items::strengthbooster}:
to make your skript faster while being easier to be accurate.