Solved How to do on death of but from a player.

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

Status
Not open for further replies.
Feb 25, 2017
21
1
0
Hey guys I currently have this skript where coins are dropped when mobs die but I want it so they have to be killed by players to drop them.

This is what I currently have...
code_language.skript:
on death of zombie:
    chance of 7%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of creeper:
    chance of 25%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of Blaze:
    chance of 18%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of CaveSpider:
    chance of 8%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of enderman:
    chance of 20%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of SilverFish:
    chance of 25%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of Skeleton:
    chance of 10%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim       
on death of Spider:
    chance of 8%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim       
on death of Wither:
    chance of 100%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of Zombie Pigmen:
    chance of 12%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   



    
on death of Cow:
    chance of 12%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim       
on death of Ocelot:
    chance of 15%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of Pig:
    chance of 5%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of sheep:
    chance of 15%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim               
on death of Wolf:
    chance of 15%:
        drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim
 
code_language.skript:
on death of whatever:
    if attacker is player:
        #stuff to drop coin
 
code_language.skript:
on death of whatever:
    if attacker is player:
        #stuff to drop coin
Now it doesnt drop them at all.
code_language.skript:
on death of zombie:
    if attacker is player:
        chance of 7%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of creeper:
    if attacker is player:
        chance of 25%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of Blaze:
    if attacker is player:
        chance of 18%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of CaveSpider:
    if attacker is player:
        chance of 8%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of enderman:
    if attacker is player:
        chance of 20%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of SilverFish:
    if attacker is player:
        chance of 25%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of Skeleton:
    if attacker is player:
        chance of 10%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim       
on death of Spider:
    if attacker is player:
        chance of 8%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim       
on death of Wither:
    if attacker is player:
        chance of 100%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of Zombie Pigmen:
    if attacker is player:
        chance of 12%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   



    
on death of Cow:
    if attacker is player:
        chance of 12%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim       
on death of Ocelot:
    if attacker is player:
        chance of 15%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of Pig:
    if attacker is player:
        chance of 5%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim   
on death of sheep:
    if attacker is player:
        chance of 15%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim               
on death of Wolf:
    if attacker is player:
        chance of 15%:
            drop 1 sunflower named "<gold>MobCoin" with lore "&rType &6/coins redeem &rto redeem" at victim
 
You can also use:

code_language.skript:
if attacker is online:

for the same effect.
 
Status
Not open for further replies.