Soulbind - Help please

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

NewbyZ

Member
Jan 26, 2017
75
2
0
25
code_language.skript:
on player drop:
    if lore of event-item contains "Soulbound":
        cancel event
command /soulbind:
    trigger:
        if player doesn't have permission "soulbind.command"
#    set the lore of the player's held item to "&6SoulBound"
        set {_lore} to lore of player's held item
        set lore of player's held item to "%{_lore}%||&6SoulBound"

on death:
    set {_lore} to "&6SoulBound"
    loop 40 times:
        set {inv::%player%::%loop-number - 1%} to slot loop-number - 1 of player
        if lore of {inv::%player%::%loop-number - 1%} does not contain {_lore}:
            delete {inv::%player%::%loop-number - 1%}
    loop drops:
        if lore of loop-item contains {_lore}:
            remove loop-item from drops
          
on respawn:
    loop {inv::%player%::*}:
        set slot "%loop-index%" parsed as integer of player to loop-value
    clear {inv::%player%::*}

My ideas:
- That the soul is an object and when you click on the object that you want to protect is applied.
- That when applied the lore is "Protected 2/2"
- When I die put "Protected 1/2"
- And when I die again erase that lore

How could it be done?
Thanks for help!
 
You'll have to save the lore of the items that contains "soulbound" in their lore, then check line by line which one has on it the "protected" word (which you would add when the player executes that comand) and then do this:
code_language.skript:
set {_current protection} to {_the var that contains the mentioned line of the lore} parsed as "Protected %num%/2"
If the current protection var is 2, you'll set that line of the lore to "Protected 1/2" and if it's 1, you'll remove that line from the lore.

P.S: you should add a cool down and also, if you want, a specify amount of money for protect the item with the "soulbound" or that command which gives the soulbound will be abused a lot by the players.
 
  • Like
Reactions: NewbyZ
I do not understand much of skript, the code that I put I took of a skript of soulbind, could you explain it another way please? :emoji_disappointed_relieved::emoji_pray:
Im noob :emoji_cold_sweat:
 
I've made a script like this some time ago. It does not have the 'Protected' item uses, but it has the click thing using a book, item limit and gives everything correctly.

https://hastebin.com/vebejuvafu.vbs - fixed this 'a bit' so you can have a base.

These are the parts I've changed:
code_language.skript:
                               # [!] Before the item is saved, you can manage it.
                               # Split the lore and then remove '1' from it.
                               set {_lore::*} to lore of loop-item split at "Protected: "
                               set {_protectamount::*} to {_lore::2} split at "/"
                               set {_protectamount::1} to {_protectamount::1} parsed as number - 1
                               if {_protectamount::1} is more than 0:
                   add loop-item to {random!::soulbound::%player%::*}
                   remove loop-item from drops
                               else:
                                   set {_lore} to lore of loop-item
                                   remove "||EVERYTHING YOU ADDED BEFORE||" from {_lore}
                                   set lore of loop-item to {_lore}

code_language.skript:
               # [!] THIS IS WHERE YOU HAVE TO SET THE "PROTECTED" THING YOU WANT.

       set lore of event-item to "%lore of event-item%||{@SBLORE}||{@SBFORGEDBY}||Protected: 3/3"
       play block portal travel at player with pitch 1

I didn't even test, so try fixing the errors by yourself ;P

I hope I've helped :emoji_stuck_out_tongue:
 
  • Like
Reactions: NewbyZ
How i fix?
db16f2051b5e9edd484ab86d557d3e98.png
 
Status
Not open for further replies.