skript not getting anything

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

frunktrunk

New Member
Mar 8, 2021
7
0
1
hello i am making a skript shop where you can exchange your very rare tokens (which have a custom name) for different items


command /shoplgrd:
trigger:
set {_item} to emerald named "&aLegendary Token"
if player's inventory contains {_item}:
remove 1 of {_item} from player's inventory
give 10 diamonds to player's inventory

this is my code, there is no error when i reload it it just doesnt give anything please help me
 
hello i am making a skript shop where you can exchange your very rare tokens (which have a custom name) for different items


command /shoplgrd:
trigger:
set {_item} to emerald named "&aLegendary Token"
if player's inventory contains {_item}:
remove 1 of {_item} from player's inventory
give 10 diamonds to player's inventory

this is my code, there is no error when i reload it it just doesnt give anything please help me
Your code works for me.

https://gyazo.com/6d506e6225b8b3a0d098d23b179f5bcd
[doublepost=1615493498,1615493324][/doublepost]What is your Skript and minecraft server version?
 
i am using 1.16.4 paper spigot server, skript, tuske, skquery is all up to date, and im running 1.16.4
I have never used Paper, I suppose there will be some differences when it comes to using skript.

I recommend you open a localhost or other server with Spigot to test this script. If it works properly, then the problem is with Paper.
 
still doesnt work, i tried it on a spigot 1.16.4 and 1.16.5 server and it just does the same thing like on paper, i click it and it doesnt consume the token or give me any diamonds
 
still doesnt work, i tried it on a spigot 1.16.4 and 1.16.5 server and it just does the same thing like on paper, i click it and it doesnt consume the token or give me any diamonds
Thats weird... Send the full code that are you using and a gif/video that shows the error.
 
Thats weird... Send the full code that are you using and a gif/video that shows the error.

this is the video, here is all of my code:


Command /shop:
trigger:
wait 1 tick
Open chest with 3 rows named "&4Token Shop" to player
wait 1 tick
Format slot 12 of player with diamond named "&b&l10 Diamonds" with lore "&3Costs 1 Legendary Token" to close then run [execute player command "/shoplgrd"]
Format slot 14 of player with brown stained glass pane named "&c&lComing soon" with lore "&bShop coming soon" to close

command /shoplgrd:
trigger:
set {_item} to emerald named "&aLegendary Token"
if player's inventory contains {_item}:
remove 1 of {_item} from player's inventory
give 10 diamonds to player's inventory
 

this is the video, here is all of my code:


Command /shop:
trigger:
wait 1 tick
Open chest with 3 rows named "&4Token Shop" to player
wait 1 tick
Format slot 12 of player with diamond named "&b&l10 Diamonds" with lore "&3Costs 1 Legendary Token" to close then run [execute player command "/shoplgrd"]
Format slot 14 of player with brown stained glass pane named "&c&lComing soon" with lore "&bShop coming soon" to close

command /shoplgrd:
trigger:
set {_item} to emerald named "&aLegendary Token"
if player's inventory contains {_item}:
remove 1 of {_item} from player's inventory
give 10 diamonds to player's inventory
Any errors on console? Have you test the code in others server version?
[doublepost=1615674559,1615672926][/doublepost]Oh wait, i just realized something about the emerald you are holding.

Just for testing, do this:

code_language.skript:
command /test1:
    trigger:
        set {_item} to emerald named "&aLegendary Token"
        give 1 of {_item} to player

command /test2:
    trigger:
        set {_item} to emerald named "&aLegendary Token"
        if player's inventory contains {_item}:
            remove 1 of {_item} from player's inventory
            add 10 diamonds to player
            send "You had it"
        else:
            send "You dont have legendary tokens."

Execute the second command after the first command. I noticed that you have NBTs on the item. This may be why the skript does not recognize you correctly the item.
 
  • Like
Reactions: frunktrunk
Any errors on console? Have you test the code in others server version?
[doublepost=1615674559,1615672926][/doublepost]Oh wait, i just realized something about the emerald you are holding.

Just for testing, do this:

code_language.skript:
command /test1:
    trigger:
        set {_item} to emerald named "&aLegendary Token"
        give 1 of {_item} to player

command /test2:
    trigger:
        set {_item} to emerald named "&aLegendary Token"
        if player's inventory contains {_item}:
            remove 1 of {_item} from player's inventory
            add 10 diamonds to player
            send "You had it"
        else:
            send "You dont have legendary tokens."

Execute the second command after the first command. I noticed that you have NBTs on the item. This may be why the skript does not recognize you correctly the item.


thank you so much!!!! my shop skript works now thank you alot!!!
 
Status
Not open for further replies.