1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

armor unequip bug

Discussion in 'Skript' started by ViperX, Jul 26, 2022.

Thread Status:
Not open for further replies.
  1. ViperX

    ViperX Member

    Joined:
    Jul 26, 2022
    Messages:
    26
    Likes Received:
    0
    Ok so when I dropping the item from my armor the armor unequip is not called so all the stats on the player are getting doubled
    here is the code of armor equip/unequip
    Code (Text):
    1. on armor equip:
    2.     #set {_dl} to line 1 of lore of event-item
    3.     set {lore::*} to event-item's lore split at "||"
    4.     set {_dl} to {lore::1}
    5.     set {_sl} to {lore::2}
    6.     set {_fl} to {lore::3}
    7.     if {lore::3} contains "Ferocity":
    8.         replace all "&7Ferocity: &c+" in {_fl} with ""
    9.     else if {lore::3} contains "Speed":
    10.         replace all "&7Speed: &a+" in {_fl} with ""
    11.     else:
    12.         replace all "&7Health: &a+" in {_fl} with ""
    13.     replace all "&7Defence: &a+" in {_dl} with ""
    14.     replace all "&7Strength: &c+" in {_sl} with ""
    15.     replace all "&7Ferocity: &c+" in {_fl} with ""
    16.     set {_d} to "%{_dl}%" parsed as an integer
    17.     set {_s} to "%{_sl}%" parsed as an integer
    18.     set {_f} to "%{_fl}%" parsed as an integer
    19.     set {def::%event-player%} to {def::%event-player%} + {_d}
    20.     if name of event-item is not "&6Warden Helmet":
    21.         set {st::%event-player%} to {st::%event-player%} + {_s}
    22.     if {lore::3} contains "Ferocity":
    23.         set {fer::%event-player%} to {fer::%event-player%} + {_f}
    24.     else if {lore::3} contains "Speed":
    25.         set {speed::%event-player%} to {speed::%event-player%} + {_f}
    26.     else:
    27.         set {hp::%event-player%} to {hp::%event-player%} + {_f}
    28.  
    29. on armor unequip:
    30.     set {lore::*} to event-item's lore split at "||"
    31.     set {_dl} to {lore::1}
    32.     set {_sl} to {lore::2}
    33.     set {_fl} to {lore::3}
    34.     if {lore::3} contains "Ferocity":
    35.         replace all "&7Ferocity: &c+" in {_fl} with ""
    36.     else if {lore::3} contains "Speed":
    37.         replace all "&7Speed: &a+" in {_fl} with ""
    38.     else:
    39.         replace all "&7Health: &a+" in {_fl} with ""
    40.     replace all "&7Defence: &a+" in {_dl} with ""
    41.     replace all "&7Strength: &c+" in {_sl} with ""
    42.     set {_d} to "%{_dl}%" parsed as an integer
    43.     set {_s} to "%{_sl}%" parsed as an integer
    44.     set {_f} to "%{_fl}%" parsed as an integer
    45.     set {def::%event-player%} to {def::%event-player%} - {_d}
    46.     if name of event-item is not "&6Warden Helmet":
    47.         set {st::%event-player%} to {st::%event-player%} - {_s}
    48.     if {lore::3} contains "Ferocity":
    49.         set {fer::%event-player%} to {fer::%event-player%} - {_f}
    50.     else if {lore::3} contains "Speed":
    51.         set {speed::%event-player%} to {speed::%event-player%} - {_f}
    52.     else:
    53.         set {hp::%event-player%} to {hp::%event-player%} - {_f}
    also there is another dupe bug that if I dropping the "Warden Helmet" from my armor and before I putting armor that gives me speed the item is dropping to the ground and duping to my helmet armor slot too here is the code of this:
    Code (Text):
    1. every 1 tick:
    2.     loop all players:
    3.         set loop-player's max health to {hp::%loop-player%} / 10
    4.         set loop-player's health to {hp::%loop-player%} / 10
    5.         if name of loop-player's helmet is "&6Warden Helmet":
    6.             set loop-player's walking speed to {speed::%loop-player%} / 1000
    7.             set loop-player's flying speed to {speed::%loop-player%} / 1000
    8.             set {_h} to loop-player's helmet
    9.             set {_st} to ({speed::%loop-player%} / 10) * 150
    10.             set {lore::*} to {_h}'s lore split at "||"
    11.             set {lore::2} to "&7Strength: &c+%{_st}%"
    12.             set line 2 of lore of {_h} to "&7Strength: &c+%{_st}%"
    13.             set {lore::*} to {_h}'s lore split at "||"
    14.             set {_l} to {lore::2}
    15.             replace all "&7Strength: &c+" in {_l} with ""
    16.             set {st::%loop-player%::warden} to {_l} parsed as an integer
    17.         else:
    18.             set {st::%loop-player%::warden} to 0
    19.             set loop-player's walking speed to {speed::%loop-player%} / 500
    20.             set loop-player's flying speed to {speed::%loop-player%} / 500
     
Thread Status:
Not open for further replies.

Share This Page

Loading...