How to check if a name has been taken

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

BlakeGamez

Member
Jun 4, 2021
1
0
1
20
Hello, how do I check if a name has been taken? I'm making a skript where people can create worlds but I want to know if the name they type in has been taken

EX:
command /example <text>:
trigger:
if arg-1 is in {taken}:
stop trigger
# say stuff
else:
# world creation cmd


I tried the skript above, but my error is that the 2nd arg isnt an entity
[doublepost=1622766806,1622765404][/doublepost]bump
 
Maybe this will do it?

Code:
command /example <text>:
    trigger:
        if {taken::*} contains arg-1:
            send "&c&lThis is taken!"
            stop
        else:
            send "&4&lDid world thing!"
            add arg-1 to {taken::*}
You just gotta add like make console execute command in the else section, but idk your world commands.
 
Maybe this will do it?

Code:
command /example <text>:
    trigger:
        if {taken::*} contains arg-1:
            send "&c&lThis is taken!"
            stop
        else:
            send "&4&lDid world thing!"
            add arg-1 to {taken::*}
You just gotta add like make console execute command in the else section, but idk your world commands.
I think this is what he wanted
 
Status
Not open for further replies.