Taking a specific head

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

JustADev

Well-Known Member
Apr 8, 2017
379
9
18
I have been playing around with this error for a while, and have come to the conclusion that I do not know how to make this work.
Question, how do i make it remove a specific player's head from inventory on an event such as right clicking the head/skull?

Here is what I have right now:
code_language.skript:
on rightclick holding a player head:
    if name of player's tool contains "Head":
        remove 1 ("Goldblock" parsed as offline player)'s head from player's inventory
        play "EAT" to player at volume 1
        apply potion of regeneration 2 to the player for 5 seconds
        apply potion of swiftness 1 to the player for 3 seconds
 
hmm perhaps something like
if name of player's tool contains "%player%":
to reference the head name specifically
 
The thing is, the skin i found was from this player's IGN of: GoldBlock... so maybe trying to remove the speicific player's head?
[doublepost=1501631402,1501631292][/doublepost]The Item I am trying to remove has the following info:
Name: &eGolden Head
Player IGN: Goldblock
 
one sec testing
[doublepost=1501632133,1501631687][/doublepost].....that's really weird it move like it's been removed but doesntXD huh
 
yeah i know, almost as if it puts it in the inventory again, but yet not
 
yeah i know, almost as if it puts it in the inventory again, but yet not
the problems definitely in the name though, not the if statement but the remove line. it will take an unnamed head properly if i remove the name
 
If it's the player's held item then try to remove the event-item from the player's inventory?
 
Hmm, it still is not recognizing that the head is a player head, is it because it is named &eGolden Head when it is given to the player?
 
Ooo try this
code_language.skript:
command /test:
    trigger:
        loop items in player's inventory:
            if name of loop-item contains "Golden Head":
                remove loop-item from player
 
Awesome I'm glad:emoji_grinning: don't forget to solve the thread if you would.
 
Status
Not open for further replies.