1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Removing item from inventory after being used

Discussion in 'Skript' started by SrirachaMC, Mar 5, 2021.

Thread Status:
Not open for further replies.
  1. SrirachaMC

    SrirachaMC Member

    Joined:
    Feb 26, 2021
    Messages:
    3
    Likes Received:
    0
    I need help with the n.%player% part because this worked when I first tried it, but I tested it again and it didn't remove the item from the player's inventory.

    on right-click with compass:
    if name of tool of player is "Teleport":
    if {compasscooldown::%player%} is set:
    stop
    set {compasscooldown::%player%} to true
    add 1 to {n.%player%}
    execute console command "msg SrirachaMC &e3"
    wait 1 seconds
    execute console command "msg SrirachaMC &c2"
    wait 1 seconds
    execute console command "msg SrirachaMC &41"
    wait 1 seconds
    make player execute command "tp SrirachaMC"
    if {n.%player%} = 3:
    remove compass named "Teleport" from player's inventory
    delete {n.%player%}
    wait 3 seconds
    clear {compasscooldown::%player%}

    on right-click with clock:
    if name of tool of player is "Glow":
    if {compasscooldown::%player%} is set:
    stop
    set {compasscooldown::%player%} to true
    add 1 to {n.%player%}
    execute console command "effect give SrirachaMC glowing 99999 5 true"
    execute console command "msg SrirachaMC &6You are now glowing"
    wait 30 seconds
    execute console command "effect clear SrirachaMC"
    if {n.%player%} = 5:
    remove clock named "Glow" from player's inventory
    delete {n.%player%}
    wait 3 seconds
    clear {compasscooldown::%player%}

    on join:
    give player compass named "Teleport"
    give player clock named "Glow"
    on respawn:
    give player clock named "Glow"
    give player compass named "Teleport"
     
  2. Marc

    Marc Active Member

    Joined:
    Nov 27, 2020
    Messages:
    94
    Likes Received:
    0
    Code (Text):
    1.  
    2. on right-click with compass:
    3.     if name of player's held item is "Teleport":
    4.         if {compasscooldown::%player%} is set:
    5.             stop
    6.         else:
    7.             set {compasscooldown::%player%} to true
    8.             add 1 to {n.%player%}
    9.             send "3"
    10.             wait 1 seconds
    11.             send "2"
    12.             wait 1 seconds
    13.             send "2"
    14.             wait 1 seconds
    15.             # Not Sure what you want here ---> make player execute command "/tp SrirachaMC"
    16.             if {n.%player%} = 3:
    17.                 remove compass named "Teleport" from player's inventory
    18.                 unset {n.%player%}
    19.                 wait 3 seconds
    20.                 clear {compasscooldown::%player%}
    21.  
    22. on right-click with clock:
    23.     if name of player's held item is "Glow":
    24.         if {compasscooldown::%player%} is set:
    25.             stop
    26.         else:
    27.             set {compasscooldown::%player%} to true
    28.             add 1 to {n.%player%}
    29.             apply glow 99999 for 5 seconds
    30.             send "You are now glowing""
    31.             wait 30 seconds
    32.             execute console command "effect clear SrirachaMC"
    33.             if {n.%player%} = 5:
    34.                 remove clock named "Glow" from player's inventory
    35.                 unset {n.%player%}
    36.                 wait 3 seconds
    37.                 clear {compasscooldown::%player%}
    38.  
    39. on join:
    40.     give player compass named "Teleport"
    41.     give player clock named "Glow"
    42.  
    43. on respawn:
    44.     give player clock named "Glow"
    45.     give player compass named "Teleport"
    46.  
    47.  
    Please learn how to use skript PROPERLY and do your research before asking!!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...