Mine Tiers

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

CzechSmazal

Member
Mar 30, 2024
1
0
1
So im making a RPG server and im making mines. I need a command that the player can execute only once

this is my code:
command /minetier buy:
permission: skript.minebuy1
trigger:
if {_hasBought::%uuid of player%} is not set:
if player's balance >= 10000:
remove 10000 from player's balance
execute console command "lp user %player% parent add mine1"
set {_hasBought::%uuid of player%} to true
send "Byl zakoupen Mine Tier 1!"
else:
send "Nemáš dostatek peněz na zakoupení Mine Tier 1."
 
Yeah, this won't work because you're using a local variable (variable name prefixed with an underscore) which gets deleted immediately after the event ends.
You can use a global variable but it will take up a lot of space in your variables.csv as its a unique variable for EVERY player, and since I assume you don't want to use a RAM variable (because then they'll be able to do the command again every time the server restarts) you have a couple options.

You can check if their luckperms group is mine1 (or a group above it)
You can use a metadata tag
You can give the command a ridiculously long cooldown