Local Message script (Client-Side)

128 views
Skip to first unread message

Hero

unread,
Aug 8, 2017, 2:37:04 AM8/8/17
to Multiplayer Piano Forum
function localMsg(msg) {   //:3
MPP.client.emit('a', { m: 'a', a: msg, p: { name: "Name_of_sender_here", color: 'rgb(255, 88, 202)' }});
};

localMsg("helloworld!");

Lamp

unread,
Aug 9, 2017, 2:55:59 AM8/9/17
to Multiplayer Piano Forum
Instead of emitting an 'a' event you can call the receive function directly
MPP.chat.receive({ a: 'Comment ça va?', p: { name: "God", color: 'rgb(247, 183, 54)' }});
This way it won't affect any other 'a' event listeners you might have (chat bots)

LGPvS

unread,
May 22, 2018, 6:44:39 AM5/22/18
to Multiplayer Piano Forum
Possible to make that message can see specified players?

среда, 9 августа 2017 г., 11:55:59 UTC+5 пользователь Lamp написал:

Lamp

unread,
Jun 27, 2018, 5:26:04 PM6/27/18
to Multiplayer Piano Forum
On Tuesday, May 22, 2018 at 3:44:39 AM UTC-7, LGPvS wrote:
Possible to make that message can see specified players?

nope, you can only send ordinary chat messages to the server and the server will always send them to others with your name and color.
Reply all
Reply to author
Forward
0 new messages