Solved Commands without "/"

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

VisoXD

New Member
Dec 22, 2023
7
0
1
14
Is it possible to make commands without "/"? It sadly cant be as simple as:
on chat:
if message is "!test":
send "test"

It has to have arguments, like:
on chat:
if message is "!test <arg>":
send "test %arg%"

But that sadly doesn't work. Is there anyway to get around that?
 
Is it possible to make commands without "/"? It sadly cant be as simple as:
on chat:
if message is "!test":
send "test"

It has to have arguments, like:
on chat:
if message is "!test <arg>":
send "test %arg%"

But that sadly doesn't work. Is there anyway to get around that?
To fix this, simply have it check a list for arguments then have it run code. Then, to have your code spit out an argument, set the message as a separate variable then split it by setting it to a list. Here's an example:
Code:
on load:
   add "test1", "test2" and "test3" to {args::*}

on chat:
   if message contains "!test":
      if message contains {args::*}:
         set {_m} to message
         set {_arg::*} to {_m} split at "!test"
         send "test %{_arg::2}%" to player
Also, you could write code to make the original message typed disappear.