Hello! I'm trying to make a system where people can set a command, then when another player executes it, it will replace %player% with their name in the command they set.
This is where is does the command:
set {_id} to arg 1
set {_command} to "%{code.%{_id}%}%"
if {code.%{_id}%.used} is true:
send "&cThis code has already been used." to player
else if {code.%{_id}%} is not set:
send "&cThis code isn't valid." to player
else:
set {code.%{_id}%.used} to true
execute console command "%{_command}%"
send "&a&lCode Redeemed!" to player
send "&7(&3%{_command}%&7)" to player
If the command I set was /say %player% and my username was GrantieYT, I want it to execute the command /say GrantieYT. Instead, it keeps executing the command /say %player%.
This is where you set the command:
set {_codeId} to random integer between 10000000000 and 99999999999
set {_command} to arg 1 # arg 1 is an optional text arg for the command
add {_codeId} to {codes::*} # this is a list for listing all the commands and such
set {code.%{_codeId}%} to {_command} # this sets the command
Any help is appreciated, thanks!