Removing item from inventory after being used

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

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

SrirachaMC

Member
Feb 26, 2021
3
0
1
23
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"
 
Code:
on right-click with compass:
    if name of player's held item is "Teleport":
        if {compasscooldown::%player%} is set:
            stop
        else:
            set {compasscooldown::%player%} to true
            add 1 to {n.%player%}
            send "3"
            wait 1 seconds
            send "2"
            wait 1 seconds
            send "2"
            wait 1 seconds
            # Not Sure what you want here ---> make player execute command "/tp SrirachaMC"
            if {n.%player%} = 3:
                remove compass named "Teleport" from player's inventory
                unset {n.%player%}
                wait 3 seconds
                clear {compasscooldown::%player%}

on right-click with clock:
    if name of player's held item is "Glow":
        if {compasscooldown::%player%} is set:
            stop
        else:
            set {compasscooldown::%player%} to true
            add 1 to {n.%player%}
            apply glow 99999 for 5 seconds
            send "You are now glowing""
            wait 30 seconds
            execute console command "effect clear SrirachaMC"
            if {n.%player%} = 5:
                remove clock named "Glow" from player's inventory
                unset {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"

Please learn how to use skript PROPERLY and do your research before asking!!
 
Status
Not open for further replies.