So I'm trying to make a command where you can make little commands like -hello or -diamond. And I have a good idea for it.
My code is:
command /command [<text>] [<text>] [<text>]:
permission: command.maker
permission message: "&4You can not run this command!"
trigger:
if arg-1 is "create":
set {_command} to "-%arg-2%"
set {_command.%arg-2%.output} to arg-3
if "%{command.list::*}%" contains "%{_command}%%nl%":
send "&4That command already exists!" to player
else:
add "%{_command}%%nl%" to {command.list::*}
send "&aCreated command -%{_command}%" to player
if arg-1 is "list":
send "&b%{_command.list::*}%" to player
if arg-1 is "clear":
set {command.list::*} to ""
send "&bReset all commands" to player
on chat:
cancel event
if "%{command.list::*}%" contains "-%{_command}%%nl%":
set {_message} to last (length of {_message} - 1) characters of message
make server execute command "/function %{_command.%{_message}%.output}%"
else:
loop all players:
send "<%player%> %message%" to loop-players
It is registering commands but not executing them. Please help
My code is:
command /command [<text>] [<text>] [<text>]:
permission: command.maker
permission message: "&4You can not run this command!"
trigger:
if arg-1 is "create":
set {_command} to "-%arg-2%"
set {_command.%arg-2%.output} to arg-3
if "%{command.list::*}%" contains "%{_command}%%nl%":
send "&4That command already exists!" to player
else:
add "%{_command}%%nl%" to {command.list::*}
send "&aCreated command -%{_command}%" to player
if arg-1 is "list":
send "&b%{_command.list::*}%" to player
if arg-1 is "clear":
set {command.list::*} to ""
send "&bReset all commands" to player
on chat:
cancel event
if "%{command.list::*}%" contains "-%{_command}%%nl%":
set {_message} to last (length of {_message} - 1) characters of message
make server execute command "/function %{_command.%{_message}%.output}%"
else:
loop all players:
send "<%player%> %message%" to loop-players
It is registering commands but not executing them. Please help