Haxball — Script

Developing HaxBall scripts primarily involves using the HaxBall Headless API

What is Haxball scripting?

Haxball scripting typically refers to writing JavaScript code that interacts with Haxball’s Room API (used in the official Haxball Headless or embedded room instances). Scripts run either: Script Haxball

Risks for Players

5. Custom Admin Tools (CAT)

For room owners who want granular control. CAT scripts add commands like: High Gravity: The ball behaves heavily

// Optional: Display points when a player leaves room.onPlayerLeave = (player) => if (room.playerStats && room.playerStats[player.id]) console.log(`$player.name left with $room.playerStats[player.id] points.`);

The onGameTick Loop

This is the most powerful—and dangerous—event. It runs every frame (about 60 FPS). Headless scripts can call external APIs to store