1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Get only numbers of send message on chat

Discussion in 'Skript' started by LucXas, Feb 6, 2018.

Thread Status:
Not open for further replies.
  1. LucXas

    LucXas Member

    Joined:
    Feb 5, 2017
    Messages:
    14
    Likes Received:
    0
    someone could help me?
    i try get the only numbers of message sended on the chat for set in a variable help me pls
    i try put if only message is a integer but not works i tip a integer and he tells me that put a integer number but i put a integer number



    on chat:
    if {mermargui.%player%} is true:
    if message conatins numbers:
    remove numbers from message
    add removed objects to {messagechat.%player%}
    set {messagechat.%player%} to message
    cancel event
    else:
    message "&cDebes poner un numero&7!"
    cancel event
     
  2. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,336
    Likes Received:
    177
    Medals:
    im not quite sure what youre trying to do but this might help (needs tuske)
    Code (Skript):
    1. on chat:
    2.     set {_numbersInMessage::*} to regex replace all "[^0-9]" with "" in message
    3.     broadcast "%{_numbersInMessage::*}%"
    4.  
    5.     set {_nonNumbers::*} to regex replace all "[0-9]" with "" in message
    6.     broadcast "%{_nonNumbers::*}%"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...