Skript - Back item when drop cancel

  • 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.
Im not sure if this works (mobs):

on death:
if victim isn't player:
clear the drops
 
Im not sure if this works (mobs):

on death:
if victim isn't player:
clear the drops
so he wants to have a telekinesis skript so:
Code:
on death of mob:
  loop drops:
    add loop-value to {_mobdrops::*}
  clear the drops
  loop {_mobdrops::*}:
    give player loop-value
 
That doesn't work for me, though it might work for you. Skip the Variable Middle-man, and also USE ATTACKER and VICTIM in Damage and Death events!

Code:
on death:
    set {num} to 0
    if victim isn't a player:
        loop drops:
            add 1 to {num}
            give attacker loop-value
            if {num} = number of drops:
                clear drops
 
  • on death:
  • set {num} to 0
  • if victim isn't a player:
  • loop drops:
  • add 1 to {num}
  • give attacker loop-value
  • if {num} = number of drops:
  • clear drops
That's very much inefficient... I wouldn't use it. I'm quite sure you could just do:
Code:
on death of mob:
    give drops to player
    clear drops
 
Status
Not open for further replies.