skript enchant mess up

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

Dinoboy

Member
Mar 14, 2020
13
0
1
30
all code Works BUT it doesnt how i want it to basicly if i did /lvl3 it would pick 1 out the 3 listed below lores and some lore would have other chances of geting picked if 1 is picked it is applied on players held item and ends but the what realy happens is a TON of lore is added and like all of them are applied please give me code and dont say add a extention or somthing as im new to skript
===
c
ommand /lvl3:
trigger:
if player is holding a weapon:
player's xp >= 149719
chance of 35%
remove 149720 from xp of player
set {_item} to player's tool
add 1 to {lore}
set line {lore} of lore of player's held item to "&cLife Line I"
chance of 25%:
remove 149720 from xp of player
set {_item} to player's tool
add 1 to {lore}
set line {lore} of lore of player's held item to "&cLife Line II"
chance of 15%:
remove 149720 from xp of player
set {_item} to player's tool
add 1 to {lore}
set line {lore} of lore of player's held item to "&cLife Line III"

====
 
I dont know if it works, but set stop after the execution of chance:
command /lvl3:
trigger:
if player is holding a weapon:
player's xp >= 149719
chance of 35%
remove 149720 from xp of player
set {_item} to player's tool
add 1 to {lore}
set line {lore} of lore of player's held item to "&cLife Line I"
stop
chance of 25%:
remove 149720 from xp of player
set {_item} to player's tool
add 1 to {lore}
set line {lore} of lore of player's held item to "&cLife Line II"
stop
chance of 15%:
remove 149720 from xp of player
set {_item} to player's tool
add 1 to {lore}
set line {lore} of lore of player's held item to "&cLife Line III"
stop

but if that doesn't work, I made a skript that worked in the vanilla version:

command /lvl3:
trigger:
if player is holding a weapon:
level of player >= "1" parsed as number:
chance of 35%:
set {_i} to level of player
set {_o} to 149719
set {_p} to {_i} - {_o}
set player's level to {_p}
set {_item} to player's tool
add 1 to {lore}
set line {lore} of lore of player's held item to "&cLife Line I"
stop
chance of 25%:
set {_i} to level of player
set {_o} to 149719
set {_p} to {_i} - {_o}
set player's level to {_p}
set {_item} to player's tool
add 1 to {lore}
set line {lore} of lore of player's held item to "&cLife Line II"
stop
chance of 15%:
set {_i} to level of player
set {_o} to 149719
set {_p} to {_i} - {_o}
set player's level to {_p}
set {_item} to player's tool
add 1 to {lore}
set line {lore} of lore of player's held item to "&cLife Line III"
stop
 
Status
Not open for further replies.