Solved Remove Item just from Hand

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

Juniorin

Member
Aug 13, 2017
23
0
0
28
How do I Remove an item from the hand. It should remove the item in my hand not inventory

on rightclick:
player is holding a firework star
remove regeneration from the player
remove slowness from the player
apply regeneration 1 to the player for 13 seconds
apply slowness 1 to the player for 5 seconds
heal the player by 0.5 hearts
message "&8[&4*&8] &7You have used &4Painkillers&7."
remove firework star from player
 
If you have the nether stars as non-stackable then you can just:
- set player's tool to air
However that will remove everything if you have them in a stack. You could also have it remove a specifically named item so it will take one, but if they have multiple stacks it may not take from the stack you want:
- remove firework star named "&4Painkillers" from the player
 
How do I Remove an item from the hand. It should remove the item in my hand not inventory

on rightclick:
player is holding a firework star
remove regeneration from the player
remove slowness from the player
apply regeneration 1 to the player for 13 seconds
apply slowness 1 to the player for 5 seconds
heal the player by 0.5 hearts
message "&8[&4*&8] &7You have used &4Painkillers&7."
remove firework star from player
remove firework star named "&4Painkillers" from the player
idiot, its
code_language.skript:
on rightclick:
    player is holding a firework star
    remove regeneration from the player
    remove slowness from the player
    apply regeneration 1 to the player for 13 seconds
    apply slowness 1 to the player for 5 seconds
    heal the player by 0.5 hearts
    message "&8[&4*&8] &7You have used &4Painkillers&7."
    remove firework star from player
    remove firework star named "&4Painkillers" from the player

As Wynnevir said above
 
idiot, its
code_language.skript:
on rightclick:
    player is holding a firework star
    remove regeneration from the player
    remove slowness from the player
    apply regeneration 1 to the player for 13 seconds
    apply slowness 1 to the player for 5 seconds
    heal the player by 0.5 hearts
    message "&8[&4*&8] &7You have used &4Painkillers&7."
    remove firework star from player
    remove firework star named "&4Painkillers" from the player

As Wynnevir said above
Don't call people idiots unless you presume to be one yourself :emoji_wink:
 
These doesnt work
[doublepost=1503155755,1503155704][/doublepost]If I have 2 stacks of "Painkillers" and I right click the 2nd stack(2nd slot) If removes from 1st slot.
 
You have to do this:
on rightclick:
player is holding a firework star named "&4Painkillers"
remove regeneration from the premove slowness from the player
apply regeneration 1 to the player for 13 seconds
apply slowness 1 to the player for 5 seconds
heal the player by 0.5 hearts
message "&8[&4*&8] &7You have used &4Painkillers&7."
remove firework star named "&4Painkillers" from the player`s tool
 
This doesnt work It removes nothing.
[doublepost=1503157931,1503156635][/doublepost]
You have to do this:
on rightclick:
player is holding a firework star named "&4Painkillers"
remove regeneration from the premove slowness from the player
apply regeneration 1 to the player for 13 seconds
apply slowness 1 to the player for 5 seconds
heal the player by 0.5 hearts
message "&8[&4*&8] &7You have used &4Painkillers&7."
remove firework star named "&4Painkillers" from the player`s tool
Your Skript doesnt work....
 
code_language.skript:
on rightclick holding firework star:
    if name of event-item is "&4Painkillers":
        remove regeneration from the player
        remove slowness from the player
        apply regeneration 1 to the player for 13 seconds
        apply slowness 1 to the player for 5 seconds
        heal the player by 0.5 hearts
        message "&8[&4*&8] &7You have used &4Painkillers&7."
        remove firework star named "&4Painkillers" from the player
 
Last edited by a moderator:
code_language.skript:
on rightclick holding firework star:
    if name of event-item is "&4Painkillers":
        remove regeneration from the player
        remove slowness from the player
        apply regeneration 1 to the player for 13 seconds
        apply slowness 1 to the player for 5 seconds
        heal the player by 0.5 hearts
        message "&8[&4*&8] &7You have used &4Painkillers&7."
        remove firework star named "&4Painkillers" from the player
Is there any way to do the code without the name &4Painkillers?
 
I figured it out the correct coding is
on right click holding firework star:
remove regeneration from the player
remove slowness from the player
apply regeneration 1 to the player for 13 seconds
apply slowness 1 to the player for 5 seconds
heal the player by 0.5 hearts
message "&8[&4*&8] &7You have used &4Painkillers&7."
remove firework star from the player's tool