Solved How to delete item(named "A") on server?

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

    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.

effiraid

Member
Jul 16, 2017
24
0
0
Aloha, i want to delete certain item on server. (also delete certain item in player's inventory and all chest in the worlds.) How can skript make it?
 
code_language.skript:
every 5 seconds:
    loop all players:
        loop all items in the inventory of loop-player:
            loop-item is diamond #Type of item
            name of loop-item is "Example" #Name of item
            remove loop-item from loop-player's inventory
This works for me. Replace every 5 seconds: with whatever time frame, however 15-20 should be fine and not cause lag. The name and type of item has been pointed out. Unfortunately, to my knowledge. checking every chest in the world would cause incredible amounts of lag, and would be rather pointless as the item isn't useful in a chest anyway. You could also use this which requires SkQuery or WildSkript but cuts down on lag by a lot (I highly suggest this version)
code_language.skript:
on inventory click:
    loop all items in the inventory of player:
        loop-item is diamond #Type of item
        name of loop-item is "Example" #Name of item
        remove loop-item from player's inventory
 
code_language.skript:
every 5 seconds:
    loop all players:
        loop all items in the inventory of loop-player:
            loop-item is diamond #Type of item
            name of loop-item is "Example" #Name of item
            remove loop-item from loop-player's inventory
This works for me. Replace every 5 seconds: with whatever time frame, however 15-20 should be fine and not cause lag. The name and type of item has been pointed out. Unfortunately, to my knowledge. checking every chest in the world would cause incredible amounts of lag, and would be rather pointless as the item isn't useful in a chest anyway. You could also use this which requires SkQuery or WildSkript but cuts down on lag by a lot (I highly suggest this version)
code_language.skript:
on inventory click:
    loop all items in the inventory of player:
        loop-item is diamond #Type of item
        name of loop-item is "Example" #Name of item
        remove loop-item from player's inventory
Thanks bro! Really nice information for me.
 
Status
Not open for further replies.