Shop Function Error

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

Donut

Well-Known Member
Mar 27, 2017
1,336
177
0
U.S.
I have this function for a shop but its always saying the player doesnt have the items needed even when they do
code_language.skript:
function test(p: player, item: item, cost: item):
    if {_p}'s inventory contains {_cost}:  
        remove {_cost} from {_p}'s inventory 
        give {_p} {_item}
    else:
        broadcast "nope"

command /test:
    trigger:
        test(player, 5 diamonds, 5 dirt)
i have no idea why that doesnt work because same exact thing works as a command:
code_language.skript:
command /test <player> <item> <item>:
    trigger:
        if arg-1's inventory contains arg-3:  
            remove arg-3 from arg-1's inventory 
            give arg-1 arg-2
        else:
            broadcast "nope"
im running spigot 1.12 and skript dev29
 
Status
Not open for further replies.