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:
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