Firstly, you will need to create a script, called like on_p2p (If you already have a p2p script, ignore this.)
Next, you will go to your GMS object's create event, and under gms_settings(), put the p2p script setting line. It should look something like this:
gms_settings(true, 1, objPlayer, objOtherPlayer);
So, that script is set. Now you will need to actually set up this p2p script.
Here was my approach:
///on_p2p(id, sender, list);
var ID = argument0;
var sender = argument1;
var dslist = argument2;
case P2P_SOUND: // This could be any number between 0-255, or a macro.
var sound = ds_list_find_value(dslist, 0); // The sound
audio_play_sound(sound, 0, false);
Lastly, you just send the p2p message anywhere you want to either a certain player ID, or all playerIDs
gms_p2p_send(P2P_SOUND, player_id, sound to play);
Last message on 13 Dec 2017