"client_sent_event" Script format

This is the script that is executed when the client sends a message.

//here eventName, messageStruct and senderClientId variables are set by defaulr
// game is also a given object, so you can scout it and its hierarchy and make any logic work
switch(eventName){
    case "some event":
    //do something
    if(senderClientId > 10){
        //just print out the event we got
        console.log(eventName)
        console.log(messageStruct) 
    }
    break;
    
    //make more cases for more events
}

Last updated