#Item Renamer

1 messages · Page 1 of 1 (latest)

bright canopy
#
command /soe item <string> <string> <string>:
    description: This command renames an item and sets its rarity, and saves the item in loot::category::itemname.
    usage: /soe item <name> <rarity> <category>
    trigger:
        set {_name} to argument 1
        set {_rarity} to argument 2
        set {_category} to argument 3
        
        if {_rarity} is "common":
            set {_color} to "&l&7" # Gray color for common
        else if {_rarity} is "uncommon":
            set {_color} to "&l&a" # Green color for uncommon
        else if {_rarity} is "rare":
            set {_color} to "&l&b" # Aqua color for rare
        else if {_rarity} is "epic":
            set {_color} to "&l&5" # Purple color for epic
        else if {_rarity} is "legendary":
            set {_color} to "&l&6" # Gold color for legendary
        else if {_rarity} is "mythic":
            set {_color} to "&l&c" # MAGENTA color for MYTHICAL THINGS
        else:
            send "&cInvalid rarity provided. Please use: common, uncommon, rare, epic, legendary." to player
            stop
        
        # Check if the player is holding an item
        if the player's tool is not air:
            # Rename the item
            set name of player's tool to "&f[%{_color}%%{_name}%&f]"

            # Add lore lines
            add "&f&m———————" to  player's tool's lore
            add "%{_color}%%{_rarity}%" to player's tool's lore

            # Save the item in loot::category::itemname
            add player's tool to loot::{_category}::{_name}
            
            send "&aSuccess! Item renamed and saved in loot::%{_category}%::%{_name}%" to player
        else:
            send "&cFailed! You are not holding an item." to player

#

thats my errors

tacit pagoda
#

Is this made with AI?

#

Read the rules #welcome-to-skunity

latent vessel
#

100%

tacit pagoda
#

Unless bro just really likes documenting and forgot how to use variables half way through

#

The code is surprisingly decent tbh

latent vessel
#

loot::{_category}::{_name}:

tacit pagoda
#

Well except for that ofc

#

Also this could be done much better but does the trick especially in a command

        if {_rarity} is "common":
            set {_color} to "&l&7" # Gray color for common
        else if {_rarity} is "uncommon":
            set {_color} to "&l&a" # Green color for uncommon
        else if {_rarity} is "rare":
            set {_color} to "&l&b" # Aqua color for rare
        else if {_rarity} is "epic":
            set {_color} to "&l&5" # Purple color for epic
        else if {_rarity} is "legendary":
            set {_color} to "&l&6" # Gold color for legendary
        else if {_rarity} is "mythic":
            set {_color} to "&l&c" # MAGENTA color for MYTHICAL THINGS
bright canopy
#

dude i dont remember anything bout skript 😢 i havent messed with lists a long time

bright canopy
#

so every line is documented where u want to look back to a code so u will understand everything

flat juniperBOT
bright canopy
#

so like i should do like this?
set loot::{_category}::* to player's tool

latent vessel
bright canopy
#

mmhmm

tacit pagoda
bright canopy
#

i added them in my code

#

its still shows the error

#

set {loot::{_category}::*} to player's tool

#

tried even to double them up

#

set {loot::{{_category}::*}} to player's tool

flat juniperBOT
#

Dumbbell (Please ping) suggests that you read this embed

Percent signs (%)
When should percent signs be used in Skript?

In Skript, the purpose of surrounding an expression in % signs is letting Skript know you want it to be parsed as an expression and insert its value into the string or variable you've put it in.

Incorrect Usage
give dirt to %player%
send "Hey there player" to %arg-1%
kill %{_entity}%```
Here, the % signs are not inside strings or variable names and should therefore be removed.
Correct Usage
broadcast "%player% has joined"
send "%{_variable::*}%" to player
set {variable::%uuid of player%} to 10```
Here, the % signs are being use properly, as a means to put expressions inside strings and variable names.
bright canopy
#

set {loot::%{_category}::*%} to player's tool
?

tacit pagoda
#

add player's tool to {loot::%{_category}%::*}