Weapon with Increase of Sharpness Per Kill

  • 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.
Jul 20, 2022
1
0
1
25
I dont even know where to start on this so far all i have is just
on death:
victim is a player:
attacker is a player:
attacker's tool:"&6Battle Blade":
 
on death:
victim is player
attacker is player
set {_level} to level of sharpness of attacker' tool
add 1 to {_level}
if name of attacker's held item contains "&6Battle Blade":
set level of sharpness of attacker's tool to {_level}
Idk if this works I suck at skripting
 
Last edited:
This solution is a bit over complicated but it makes sure that if the attacker changes his weapon right as they kill the player that they cannot enchant a random item. My testing says that this works just fine and I also felt like it was necessary to make the code for when you died you lost the enchantment. If you have any further question don't hesitate to ask, cool idea but if you want this to be balanced I would probably put a cap on how much sharpens the sword can get.

Code (skript):
#main code
on death of player:
if attacker is player:
if attacker is holding iron sword named "&6Battle Blade":
add 1 to {sharpness::%attacker%}
loop all items in the attacker's inventory:
if loop-item is iron sword named "&6Battle Blade":
enchant loop-item with "sharpness %{sharpness::%attacker%}%" parsed as enchantment type


#to reset the sharpness on death
on death of player:
loop all items in the victim's inventory:
if loop-item is iron sword named "&6Battle Blade":
set {sharpness::%victim%} to 0
disenchant loop-item
 
Last edited:
Status
Not open for further replies.