Check a directory for a yml file

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

bred

Member
Mar 9, 2018
1
0
0
25
So I am trying to make a skript where a player can buy a warp with in game money and it sets it to the position that they are standing in. I have gotten this part down already but I want to make it so that when a player buys a warp, they are not able to set a warp that is already used. I figure that I could get it to check the warps directory with some line of text like this "plugins/essentials/warps/%arg%.yml" but I'm not sure how to do it.
Here is what my skript looks like so far:
code_language.skript:
command /buywarp [<text>]:
    description: Ranks the player up
    usage: /buywarp
    permission: skript.buywarp
    permission message: You don't have permission to use this command.
    executable by: players
    trigger:
        if arg is not set:
            Send "&7[&6WarpCreator&7] &9Please create a warp like this, &c/buywarp (warp)"
            stop
        if file "plugin /essentials/warps/%arg%.yml" doesn't exists:
            player's balance is more than or equal to 5000
            make console execute command "/world world"
            make console execute command "/user %player%"
            make console execute command "/user addperm essentials.createwarp"
            make player execute command "/setwarp %arg%"
            make console execute command "/user rmperm essentials.createwarp"
            make console execute command "eco take %player% $5000"
            make player execute command "bal"
            send "&f[&6WarpCreator&f]&bYOu have purchased a warp!"
            broadcast "&7[&6WarCreator&7]&c%player% &9has just purchased &c/warp %arg%"
        Else:
            send "&f[&6WarpCreator&f]&9Sorry, but you do not have enough money to purchase a warp."
        stop
 
Status
Not open for further replies.