hello, i have a list called {items} and i want to do a function that checks if the player has one of the items in his inventory if yes remove the items.
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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
I know this is a typo but I died.check if your list contains the pooped item
Could you maybe give me a code?Just loop all items in the player's inventory, check if your list contains the pooped item and then if so remove the looped item from the player's inventory.
You can't use percent signs if you're not in a string. And using string removes item properties like custom name and lore. Use loop-value is event-item instead.if %loop-item% is %event-item%:
on pickup:
loop {banneditems::*}:
1 of event-item is 1 of loop-value #Using 1 of because if for some reason you pickup 23 'banned steaks' it will let you unless you specifically added 23 steaks to {banneditems::*}
cancel event
delete event-entity
stop
add player's tool to {banneditems::*} #Good.
add "%player's tool%" to {banneditems::*} #Bad.
snip
on pickup:
if {banneditems::*} contains event-item:
remove event-item from event-player's inventory
add player's tool to {banneditems::*} #Good.
add "%player's tool%" to {banneditems::*} #Bad.
it says "player`s tool is not an entity type" my code:
[SPOILER="CODE"]
command /cyberitems [<Text>]:
trigger:
if arg 1 is "add":
add player`s tool to {banneditems::*}
message "&bDas Item &c%player`s tool% &bWurde auf die item Banliste Hintugefügt!"
stop
[/SPOILER]
Couldn't something like this also work?
player`s tool
It should, but it's known that the contains condition doesn't work well.Couldn't something like this also work?
code_language.skript:on pickup: if {banneditems::*} contains event-item: remove event-item from event-player's inventory
Not sure if I wrote that correctly since I'm RDP'd through my phone.
It was the auto correct haha.I know this is a typo but I died.