How to run code with NPC interaction button
I've created a code for agent. To execute it I need to open chat command and type in "run" (e.g).
Is there a way o activate my code by NPC button or command block button ?
-
No
0 -
Hi Marcin Kowalski,
You could use something like this:
Hope it helps!
-1 -
Hi Cathy, that is not what Marcin is looking for. That's the opposite. Currently it is not possible to execute MakeCode code via commands. There is only the "on message" event, and that is listening for the player to send a message. Marcin is looking for a way to execute agent code with a command block or npc.
0 -
I tried creating an event handler - waiting for a chat command. The NPC can say the command, but it is said BY the NPC, not by the player, so nothing happens.
I don't see an event handler for anything an NPC does. I think NPCs can only run direct commands from the chat window. I think Ryan Barrett has it right.
0
Please sign in to leave a comment.
Comments
4 comments