Issue with OnPickup Event

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

Mightybrothers1

New Member
Jun 17, 2024
5
0
1
19
I currently have a skript so that whenever a player picks up a unique item it adds it to an array for the player so they cannot pickup the same item twice, however i have an issue where they can pickup 3 of an item and it will count as a different one than 1 of the same item, i need a way to avoid this so its based on what item it is and not how many of it, i tried using event-itemtype and it still says e.g 3 of dirt and then you can throw one on the ground and it will say picked up 1 of dirt and count them both.

Any help would be appreciated as I am struggling with this. Thank You.
 
show the skript
1718649102670.png

My bad here it is, ignore the dofind it is true
 
show an example or show me your server because im not realy understanding
 
https://streamable.com/l6qrc1 Here is an example of what is currently happening which i am trying to fix, so item picked up, adds it to an array for the player so it knows the player has picked up that item before because it doesn't do anything if they already have picked it up before. But the problem shown is that it counts 2 ferns separate to 1 fern so they can just drop 3 then pickup then drop 4 then pickup to do it infinitely when they have technically already collected that item, hope that makes it make more sense thank you for responding
 
im sorry i cant understand maybe if you have any other skript issues you cant tell me im sorry im not rly good at skripting gui and inventory im good at commands and things like that
 
try with this modify, and if you can/want put the code in </> button, i want to try to debug it. :emoji_slight_smile:
Code:
if {pickupitems::%player's uuid%::*} does not contain event-itemtype:
    add event-itemtype to {pickupitems::%player's uuid%::*}
 
try with this modify, and if you can/want put the code in </> button, i want to try to debug it. :emoji_slight_smile:
Code:
if {pickupitems::%player's uuid%::*} does not contain event-itemtype:
    add event-itemtype to {pickupitems::%player's uuid%::*}
Thank you very much for the reply, unfortunately that didn't work it still counts all instances of different amounts, also that video link is expired so lmk if you want me to reupload it for like a video example, here is the code (removed the dofind bit so you can debug):

Code:
on pickup:
    if {pickupitems::%player's uuid%::*} does not contain event-itemtype:
        add event-itemtype to {pickupitems::%player's uuid%::*}
        message "&6&lYou Have Collected &b&l%event-itemtype%" to player
        play "ENTITY_ARROW_HIT_PLAYER" to player
        execute console command "scoreboard players add %player% indivpoints 20"
        execute console command "scoreboard players add %player% tempscore 1"
        set {_team} to team name of team of player
        add 20 to {%{_team}%points}
    else:
        message "&6&lAlready Collected!" to player
 
:emoji_blush: tell me if all work
I use "broadcast ****" or "send **** to player/event-player/attacker/victim/console" to debug, like this i understand if everything works fine.