Text contains

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

dikicsHUN

Member
Nov 22, 2023
3
0
1
Hello guys! I need a help with the skript. My problem is the next:I have an example variable (_example,variable}, and contains ex: "test", "test1," test", test"
And i want to do this:
set {_example} to number of "test" in {_example.variable}

or another methode, can,t make this with loop, because is a single value, and contains same texts, and i need to check the numbers of same text.
 
if you want to send some values of it, use
Code:
add "text" to {example::*}
set {_something} to a random element out of {example::*}
broadcast "%{_something}%"

if you want to put this into a command:
Code:
command /randshout [<text>] [<text>]:
  permission: shout
  permission message: You do not have permission to do this!
  trigger:
    if arg-1 is "add":
      add arg-2 to {%player's uuid%.message.list::*}
      send "&a%arg-2% has been added to your message list!" to player
    if arg-1 is "remove":
      if arg-2 is not in "{%player's uuid%.message.list::*}":
        send "&4This is not in your message list!" to player
      else:
        remove arg-2 from {%player's uuid%.message.list::*}
        send "&4%arg-2% has been removed from your message list!" to player
    if arg-1 is "send":
      set {_broadcast} to a random element out of {%player's uuid%.message.list::*}
      broadcast "%{_broadcast}%"
    if arg-1 is "reset":
      remove everything from {%player's uuid%.message.list::*}
      send "&aList successfully resetted!" to player

Hope this helps :emoji_slight_smile:
 
Thank you for the help. The problem is the next:
I have only a single text variable.... ex: {_test} not {_test::*} and i cant to do this.

I want to use this example format, only with the single variable...
set {_example} to number of stone in {_p}'s inventory
and i want this example to use
set {_var.numbers} to number of "example text" in {_var}

I want to count X text in a single variable.
 
Last edited: