NightDev Community Forums

How to write custom commands

Help me!
I’m sorry if it’s strange because I’m typing with the translation function.

For $ (user) with custom command
“$ (User) goes straight on the road”
“$ (User) turns right on the road”
“$ (user) turns the road back”
I want to select one of them randomly and return it in response.

In this case, please tell me what syntax should be written in the response item.

@chloe_chloe

This command will output one of those random phrases.

$(user) $(eval a=[`goes straight on the road`,`turns right on the road`,`turns the road back`];a[Math.floor(Math.random()*a.length)])

You can add more phrases. Just make sure each phrases is surrounded by backticks and separated by commas as shown above.

1 Like

Thank you!ありがとう!
I will try various things based on the contents.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.