Can i get 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 community!

    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!

FuFupackgod

Member
Jun 20, 2024
1
0
1
So i have a problem here
My problem is that it wont drop cooked porkchop even if i have a sword with fire aspect on it

Code:
on death:
    if victim is pig:
        if attacker is a player:
            if attacker's item is not enchanted with fire aspect:
                cancel drops
                set {_porkToGive} to random integer between 1 and 3
                give {_porkToGive} of porkchop named "&c&lPorkchop" to attacker

on death:
    if victim is pig:
        if attacker is a player:
            if attacker's item is enchanted with fire aspect:
                cancel drops
                set {_cookedporkToGive} to random integer between 1 and 3
                give {_cookedporkToGive} of cooked porkchop named "&8&lCooked Porkchop" to attacker
 
ok so if you use attacker's item it is unreliable. you can change it to attacker's tool or you can do

if name of tool of player is "<name>"
and make the fire aspect weapon named something different.