I have a small problem and as soon as the player opens the inventory an item is deleted from the inventory and it should not be picked up again but the whole thing with opening the inventory doesn't work. I replaced it with clicking on the inventory for now, but I have a problem with picking up the item because it doesn't work because items are only written in lowercase by the script and also sometimes written completely differently like with leaves. Does anyone have an idea how to fix this?
Code:
on load:
set {remove} to ""
on inventory click:
set {_items::*} to all items of player
set {_item} to random item out of {_items::*}
add "%{_item}% , " to {remove}
remove {_item} from all players
broadcast "&8Du hast kein &c%{_item}%&8 mehr du bastard"
on pick up:
if {remove} contain event-item's type:
remove {_item} from all players
command /cock:
trigger:
broadcast "&4%{remove}%"