Clone or download the Haxball Headless Client from GitHub (e.g., haxball-headless by mertushka).
Place a custom script (e.g., volleyball.js ) in the scripts/ folder and require it in main.js :
In the terminal, type:
Save as simpleGoalScript.js , require it in your main script, and restart the room.
// simpleGoalScript.js function init(room) { // Listen for the goal event room.onGoal = (goalData) => { const scorerName = goalData.scorer.name; const scorerId = goalData.scorer.id;