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
#Item Renamer
1 messages · Page 1 of 1 (latest)
100%
Unless bro just really likes documenting and forgot how to use variables half way through
The code is surprisingly decent tbh
loot::{_category}::{_name}:
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
dude i dont remember anything bout skript 😢 i havent messed with lists a long time
i was learning c and cpp for the last 2 years
so every line is documented where u want to look back to a code so u will understand everything
Dumbbell (Please ping) suggests that you read Sovde's Variable Tutorials
so like i should do like this?
set loot::{_category}::* to player's tool
truly requiring documentation to understand
mmhmm
You are missing the {}
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
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.
set {loot::%{_category}::*%} to player's tool
?
add player's tool to {loot::%{_category}%::*}