Example HaxBall Scripts for HaxBall Coders
Before checking out the scripts, we partition them into miscellaneous levels by their difficulty or effect in room. At the end of the day, there are three levels as the following: Beginner, Intermediate and Advanced. Now, let's take a look turn by turn:
Here, usually easily-made ones take place.
- Script for making your rooms controllable by administrators: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/AdminSlot.js
- Script for teleporting the ball from a certain point to a certain point: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/BallZoneCheckAndTeleport.js
- Basketball bot with score controlling (x2 or x3 according to distance): https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/Basketball.js
- Keep your room clean against toxic players: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/Blacklist.js
- Script for clearing the ban of a specific player: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/Clearban.js
- Script for determining if the players collide with each other during the game: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/Collision.js
- Ban players with command: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/CommandBan.js
- Script for preventing duplicated connections from the same source: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/DuplicatedConnections.js
- A recently popular script (to see joining history of players) which was also shared on GitHub HaxBall issues wiki: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/JoiningHistory.js
- A funny game in which the players try to kick the target player in a certain time (it's recommended to use HaxBall All in one Tool): https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/KickGame.js (May still have some bugs, will be fixed later)
- A lightweight zone control script ready to be enhanced: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/MarkedZone.js
- Script for moving players from a team to another one: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/MovePlayers.js
- A script for finding the nearest player to ball during the game: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/Nearest_Player.js
- Keep players' avatar constant: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/PlayerAvatarControl.js
- A script for adjusting player radiuses and avatars after goals: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/PlayerRadiusAvatarSetting.js
- An overrated seeming script to change player radius by command: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/RadiusSetting.js
- Ranks with base points: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/Ranks.js
- A script for seeing player statistics. Has been created after a topic on GitHub: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/RankSystem.js
- A simple rock - paper - scissors game based on randomness: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/RockPaperScissors_v1.js
- Rock - paper - scissors game with point check: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/RockPaperScissors_v2.js
- Players will gain (or lose) no points on draw: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/RockPaperScissors_v3.js
- Slow mode script for keeping clean the chat section: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/SlowMode.js
- A script to keep flooders away: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/Spam_Mute.js
- A script for separating users according to VIP status: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/VIP_Roles.js
- A script for logging the data in your room to discord: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/Webhooks.js
- Simple betting system for HaxBall players: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/XPSystem_v1.js
- Simple betting system with localStorage for HaxBall players: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/XPSystem_v2.js
- Another (but easier) script for check whether a player is inside or outside a certain zone: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/ZoneCheck.js
Here, average weighted scripts take place.
- A script which prevents three players of the same team to be in a certain zone in the same time: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/3DefLines.js
- A script for catching the bad words and banning those who used them: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/Badwords.js
- A script for counting player detections during (and at the end of) the game: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/CollisionDetection_Counter.js
- A script for any purpose within counting down or up: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/Counter.js
- Finish line evaluation for some basic cases: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/FinishLine.js
- A script to wait for giveups: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/GiveUp.js
- A script to adjust after-goal effects: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/Goal_AfterEffects.js
- A script to let the players ignore who they don't want to get messages: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/Ignore.js
- Simple login system with some constraints: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/Login.js
- Script for voting maps: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/MapVote.js
- Script for freezing players by command, like as in the case of Mario Kart room but simple: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/PlayerFreeze.js
- A script for teleporting red player immediately after the kick-off: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/Player_Teleport_After_KickOff.js
- A new login script with registration: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/Register-Login.js
- A script for moving yourself to the bottom or the top (logic may be hard to get the point so it's an intermediate example): https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/ReorderPlayers.js
- A script for asking pauses during the game in an auto-controlled room: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/TacticalTimeout.js
- Script for chatting with your team's members: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/TeamChat.js
- A wide repository of team uniforms which are able to set by commands but may seem as overrated: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/Uniforms.js
Now, let's the time to see hard-coded ones:
- A script to track admin changes in the room, may seem as underrated but requires a fresh brain and patience: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Advanced/Admin.js
- Player avatars will be available to be overrided with this script. Impossible is nothing: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Advanced/AvatarOverride.js
- Bots also should be able to detect collisions: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Advanced/CollisionDetection.js
- Spammers can abuse the room also by using the commands, now let's make the room great again: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Advanced/CommandAbuseDetection.js
- MVP Script with localStorage, another underrated seeming script: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Advanced/MVP.js
- Mute players for a certain time by command: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Advanced/Mute.js
- Players will be able to adjust their radius during the game with some restrictions: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Advanced/RadiusSetting_CommandUsage.js
- Vote players to make them banned: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Advanced/VoteBan.js
That's all for now. Stay await for the incoming ones...