Remove event item on pickup

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

K_Abbage

Member
Feb 9, 2022
4
0
1
34
So i want to make a script that replaces the items after pickup but it seems to occur before it goes into your inventory.
So of course, it doesn't remove the picked up item. (Also i don't want to cancel the pickup event and then kill the item because i want the pickup animation)
Code:
on pickup of any log:
    set {_logcount.%player%} to item amount of event-item
    give {_logcount.%player%} of spruce logs to the player
    remove {_logcount.%player%} of event-item from the player
 
Code:
on pickup:
    event-item is any log:
        set {_logcount.%player%} to amount of event-item
        remove {_logcount.%player%} from player's inventory
        wait 5 ticks
        give player {_logcount.%player%}
 
Status
Not open for further replies.