Solved Can anyone try to help plz

  • 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.
1. Don't use the on any move event, it could become harmful to the server's performance at some point and I doubt you need it for this task.
2. Don't use WildSkript at all, it's a bad addon.
3. You're better off start using list variables, {this.format} in variables is discouraged because the format: {script-name::category::%object%::property} (would be something like {xp-enchant::%player's uuid%} for you) is way better and here is why:
  • You can clear the variables just by doing:
    code_language.skript:
    clear {my-variable::*} # all variables that start with "my-variable" will be deleted.
  • You can loop it.
  • Makes variable sorting (for things like leaderboards) a lot easier.
 
Last edited:
i dont really get it, if i use {xp-enchant::%player's uuid%} is it just same as {xp-enchant::%player%} ??
i want to have a pickaxe with its own value if you move or break plz :emoji_slight_smile:
Well not exactly the same but kind of; storing objects by UUID is just better in-case the user has changed of name, so if I used {xp-enchant::%player%} and the player changed their name, they would lose all the xp they had on the tool.

Now, regarding your issue, what you could do is applying a kind of UUID to the item (preferably on its NBT but since you can't really use NBT in Skript 1.12+ you may use the lore for it) and reference it that way. Does everyone get this enchant just by picking up/crafting a pickaxe or do you have to apply it somehow? If it's the latter then you would just add the UUID to the lore when they enchant it, but if it's the former then it's a bit more complicated.
 
about the uuid thx

and my issue..
can you send the code of it how i want it to work i still dont get it sorry :emoji_slight_smile:
[doublepost=1521720330,1521718990][/doublepost]everyone gets the enchants on the lore on block break if the lore isnt set and on pickup and on anymove
[doublepost=1521720362][/doublepost]but i still dont know how to ride the code can you help me plz :emoji_slight_smile:
They basically told you how to do it. Spoon feeding is frowned upon so here are the docs: https://docs.skunity.com/
 
i still dont undestand it... sorry
can you please help me :/
[doublepost=1521758793,1521730252][/doublepost]can anyone help?
 
Nothing and a question mark? So you’re putting a variable into your skript and you don’t even know anything about it?
[doublepost=1521829933,1521827369][/doublepost]Ok so I'm going to help you out based on the info you gave us

code_language.skript:
options:
    lore0: Whatever lore you want or have already written

on any move:
    if player is holding a pickaxe:
        if lore of player's tool does not contain "&a&lPickaxe":
            set {xpenchant::%uuid of player%} to "nothing?"   #< -- Putting that there, because thats what you said
            set line 3 of lore of player's tool to "&a&lPickaxe"
            set line 4 of lore of player's tool to "&8(&a%{xpenchant::%uuid of player%}% &7/ &750&8)"
            set line 5 of lore of player's tool to "{@lore0}"
            stop
         
on break of ore:
    if player is holding a pickaxe:
        if lore of player's tool contains "&a&lPickaxe":
            add 1 to {xpenchant::%uuid of player%}
            set line 4 of lore of player's tool to "&8(&a%{xpenchant::%uuid of player%}% &7/ &750&8)"

I personally wouldn't use the "on any move" event, because that will be checking a lot of players A LOT of times. I would use "on break" so the first time they break something with that pick, it'll change the name/lore of the tool

Also, follow Snow's suggestion using %uuid of player% instead of %player% ... helps with future name changes
 
Last edited:
Are you wanting help writing this Skript or are you wanting someone to write it for you?
Because a few people have helped you here, and each time someone helps you, the idea of your skript changes.
I would love to help, but I solved your issue, and you respond with "That is not what I want, I wanted {this}" but you never told me what {this} was in the first place.
 
The best way to do this is make an event for anything that has to do with a change in the player's inventory. Here are some examples:

code_language.skript:
on pickup:
    if event-item is a pickaxe:
        set {_tag} to tag "value" of nbt of event-item
        if {_tag} is not set:
            add "{value:1}" to nbt of event-item

on inventory click:
    if clicked item is a pickaxe:
        set {_tag} to tag "value" of nbt of clicked item
        if {_tag} is not set:
            add "{value:1}" to nbt of clicked item

on break:
    player's held item is a pickaxe
    set {_tag} to tag "value" of nbt of player's held item
    if {_tag} is not set:
        add "{value:1}" to nbt of player's held item
    else:
        set {_tag} to {_tag} parsed as integer
        add 1 to {_tag}
        add "{value:%{_tag}%}" to nbt of player's held item
 
quick question, how do i add it to my lore as i did
with the format
set line 3 of lore of player's tool to "&a&lPickaxe"
set line 4 of lore of player's tool to "&8(&a%{xpenchant.%player%}% &7/ &750&8)"
set line 5 of lore of player's tool to "{@lore0}"

thx for the the rest of the help <3
 
quick question, how do i add it to my lore as i did
with the format
set line 3 of lore of player's tool to "&a&lPickaxe"
set line 4 of lore of player's tool to "&8(&a%{xpenchant.%player%}% &7/ &750&8)"
set line 5 of lore of player's tool to "{@lore0}"

thx for the the rest of the help <3

code_language.skript:
on break:
   player's held item is a pickaxe
   set {_tag} to tag "value" of nbt of player's held item
   if {_tag} is not set:
        add "{value:1}" to nbt of player's held item
        set line 3 of lore of player's held item to "&a&lPickaxe"
        set line 4 of lore of player's held item to "&8(&a1 &7/ &750&8)"
        set line 5 of lore of player's held item to "{@lore0}"
    else:
        set {_tag} to {_tag} parsed as integer
        add 1 to {_tag}
        add "{value:%{_tag}%}" to nbt of player's held item
        set line 4 of lore of player's held item to "&8(&a%{_tag}% &7/ &750&8)"

#This is one of the many ways to accomplish what you want.
 
Last edited:
i am sorry but i am not very good at script can you sendt the full code <3
thx for the help
 

code_language.skript:
on break:
   player's held item is a pickaxe
   set {_tag} to tag "value" of nbt of player's held item
   if {_tag} is not set:
        add "{value:1}" to nbt of player's held item
        set line 3 of lore of player's held item to "&a&lPickaxe"
        set line 4 of lore of player's held item to "&8(&a1 &7/ &750&8)"
        set line 5 of lore of player's held item to "{@lore0}"
    else:
        set {_tag} to {_tag} parsed as integer
        add 1 to {_tag}
        add "{value:%{_tag}%}" to nbt of player's held item
        set line 4 of lore of player's held item to "&8(&a%{_tag}% &7/ &750&8)"

This works. If it doesn't work for you, then there is something wrong with your version. I just tested this on latest bensku, 1.12.2 spigot, and 1.12 SkStuff.
[doublepost=1522257240,1522181290][/doublepost]If you are done here, set the post to Solved.
 
Status
Not open for further replies.