Need help to clear player at variable

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

agakcw

New Member
Oct 19, 2023
9
0
1
23
command dungeontest:
trigger:
if player has permission "kraken.join":
if {dungeon::*} does not contain player:
add player to {dungeon::*}
send "&aKamu memasukin dungeon"
else:
send "&eKamu sudah pernah masuk!"
else:
send "&cNope"

command cleardungeon <player>:
permission: dungeon
trigger:
clear %arg-1% to {dungeon::*}
send "Clear Dungeon!"


i want to clear specific player to variable
 
command dungeontest:
trigger:
if player has permission "kraken.join":
if {dungeon::*} does not contain player:
add player to {dungeon::*}
send "&aKamu memasukin dungeon"
else:
send "&eKamu sudah pernah masuk!"
else:
send "&cNope"

command cleardungeon <player>:
permission: dungeon
trigger:
clear %arg-1% to {dungeon::*}
send "Clear Dungeon!"


i want to clear specific player to variable
Your issue is the wording on the line in which removes the specified argument from the variable (Notice I put removes in bold). Provided below (As a spoiler) is the code fixed. You could also try to resolve your issue based on what I've stated and check to see if you came to the same solution I did.
Code:
command cleardungeon <player>:
    permission: dungeon
    trigger:
        if {dungeon::*} contains arg-1: # Optional but checks if player is in dungeon
           remove arg-1 from {dungeon::*} # We don't put percents around arg-1 since it's not a text
           send "&aSuccess! &2%arg-1% &bwas removed from the dungeon&3!" to player # Sends it to the executor of the command (Using just 'send' makes it so anyone can see the message [Which is undesirable])
        else: # If player's not found in the dungeon list variable, it returns an error
           send "&cSorry! &4%arg-1% &3was not found in the dungeon&b!" to player
Hope this helps! Also make sure to read the notes I provided in the code I sent to make sure you understand why I changed the things with it the way I did, that way you'll be able to learn & potentially prevent the possibility of future errors in your code!