If a chat message are letters

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

Wynandus

Member
Aug 23, 2017
15
0
0
24
Hello there, how can i check if a chat message are letters and not numbers,

So for example:
If the chat message is: Cheese. It sends the message
but if the chat message is: 12345. It cancels the message and sends to the player that they only can use letters

Is this possible? Can anyone help?
 
Hello there, how can i check if a chat message are letters and not numbers,

So for example:
If the chat message is: Cheese. It sends the message
but if the chat message is: 12345. It cancels the message and sends to the player that they only can use letters

Is this possible? Can anyone help?
Yea just use the if message contains condition and check for numbers 0 - 9.
 
It doesn't work, now if i type something in for example "Josh" it also doesn't work, i'll send my code hope you understand it. Once i type for example "Josh" it also runs everything under the else
code_language.skript:
                        if message regex matches "[a-zA-Z]":
                            set {player.%uuid of player%.hasclan} to 1
                            set {clan.%message%.leader} to uuid of player
                            set {clan.%uuid of player%.name} to message
                            set {clan.used.%message%} to message
                            add "%player%" to {clan.%message%::*}
                            message "{@prefix} {@clan_created}"
                            delete {player.%uuid of player%.creating}
                            stop
                        else:
                            message "{@prefix} &cPlease don't use illegal characters."
                            delete {player.%uuid of player%.creating}
                            stop
 
Last edited:
It doesn't work, now if i type something in for example "Josh" it also doesn't work, i'll send my code hope you understand it. Once i type for example "Josh" it also runs everything under the else
code_language.skript:
                        if message regex matches "[a-zA-Z]":
                            set {player.%uuid of player%.hasclan} to 1
                            set {clan.%message%.leader} to uuid of player
                            set {clan.%uuid of player%.name} to message
                            set {clan.used.%message%} to message
                            add "%player%" to {clan.%message%::*}
                            message "{@prefix} {@clan_created}"
                            delete {player.%uuid of player%.creating}
                            stop
                        else:
                            message "{@prefix} &cPlease don't use illegal characters."
                            delete {player.%uuid of player%.creating}
                            stop
right sorry I did it wrong
code_language.skript:
if message regex matches "[a-zA-Z]+":
 
Status
Not open for further replies.