Closed Teteule closed 3 years ago
Hii Coders, I need a basketball script. When a team makes a basket, they score two points. If a basket is made outside of the three-point arc, then that basket is worth three points. Basketball Map: botbasquete3.txt
@Teteule You can use the following script:
var Map = `{"name":"CBB x3","width":910,"height":503.75,"spawnDistance":205,"bg":{"type":"none","width":653,"height":320,"kickOffRadius":0,"cornerRadius":0,"color":"424242"},"vertexes":[{"x":875,"y":-83,"bCoef":0,"cMask":["ball"],"trait":"line","vis":true,"color":"FFFFFF","curve":0},{"x":604,"y":87,"bCoef":0,"trait":"line"},{"x":603,"y":-81,"bCoef":0,"trait":"line"},{"x":800,"y":400,"bCoef":0,"trait":"line"},{"x":802.5,"y":-400,"bCoef":0,"trait":"line"},{"x":875,"y":400,"bCoef":0,"trait":"line"},{"x":875,"y":-400,"bCoef":0,"trait":"line"},{"x":829.88835849334,"y":20.182809793401,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":180},{"x":830.07764926616,"y":-19.816742316633,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":180},{"x":829.88835849334,"y":20.182809793401,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":-180},{"x":830.07764926616,"y":-19.816742316633,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":-180},{"x":848.95439751609,"y":6.2728796719796,"bCoef":0,"cMask":["ball"],"trait":"table","color":"292929"},{"x":859.95427434635,"y":6.3249346345054,"bCoef":0,"cMask":["ball"],"trait":"table","color":"292929"},{"x":849.01118474794,"y":-5.7269859610307,"bCoef":0,"cMask":["ball"],"color":"292929"},{"x":860.0110615782,"y":-5.6749309985049,"bCoef":0,"cMask":["ball"],"color":"292929"},{"x":829.91201983994,"y":15.182865779647,"bCoef":0,"cMask":["all"],"curve":-180},{"x":830.05398791956,"y":-14.816798302878,"bCoef":0,"cMask":["all"],"curve":-180},{"x":829.91201983994,"y":15.182865779647,"bCoef":0,"cMask":["all"],"curve":180},{"x":830.05398791956,"y":-14.816798302878,"bCoef":0,"cMask":["all"],"curve":180},{"x":829.88835849334,"y":20.182809793401,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":-180,"color":"e01612"},{"x":830.07764926616,"y":-19.816742316633,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":-180,"color":"e01612"},{"x":859.65140910984,"y":70.32421801056,"bCoef":0.1,"cMask":["red","blue"],"curve":-80,"vis":true,"color":"bbbbbb"},{"x":860.31392681471,"y":-69.674214374559,"bCoef":0.1,"cMask":["red","blue"],"curve":-80,"vis":true,"color":"bbbbbb"},{"x":859.65140910984,"y":70.32421801056,"bCoef":1.15,"cMask":["all"],"trait":"table"},{"x":865.65134192634,"y":70.352611626483,"bCoef":1.15,"cMask":["all"],"trait":"table"},{"x":866.31385963122,"y":-69.645820758636,"bCoef":1.15,"cMask":["all"],"trait":"table"},{"x":860.31392681471,"y":-69.674214374559,"bCoef":1.15,"cMask":["all"],"trait":"table"},{"x":862.66557232605,"y":67.338448410269,"trait":"table"},{"x":863.299696415,"y":-66.660051158345,"trait":"table"},{"x":874.6512411511,"y":70.395202050368,"bCoef":0.5,"cMask":["ball"],"curve":0},{"x":864.65135312359,"y":70.347879357162,"bCoef":0.5,"cMask":["ball"],"curve":0},{"x":875.31375885598,"y":-69.603230334751,"bCoef":0.5,"cMask":["ball"],"curve":0},{"x":865.31387082847,"y":-69.650553027957,"bCoef":0.5,"cMask":["ball"],"curve":0},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":0,"y":468.75,"bCoef":0,"cMask":["red","blue"],"trait":"kickOffBarrier"},{"x":0,"y":-468.75,"bCoef":0,"cMask":["red","blue"],"trait":"kickOffBarrier","curve":180},{"x":0,"y":90,"bCoef":0,"cMask":["blue"],"cGroup":["redKO"],"trait":"kickOffBarrier"},{"x":0,"y":-90,"bCoef":0,"cMask":["blue"],"cGroup":["redKO"],"trait":"line"},{"x":-874,"y":-83,"bCoef":0,"cMask":["ball"],"trait":"line","vis":true,"color":"FFFFFF","curve":0},{"x":-874,"y":87,"bCoef":0,"cMask":["ball"],"trait":"line","vis":true,"color":"FFFFFF","curve":0},{"x":-600,"y":-82,"bCoef":0,"trait":"line"},{"x":-601,"y":86,"bCoef":0,"trait":"line"},{"x":-802.5,"y":-400,"bCoef":0,"trait":"line"},{"x":-802.5,"y":400,"bCoef":0,"trait":"line"},{"x":-875,"y":-400,"bCoef":0,"trait":"line"},{"x":-875,"y":400,"bCoef":0,"trait":"line"},{"x":-829.88059685396,"y":-20.499471681917,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":180},{"x":-830.0851503798,"y":19.500005287852,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":180},{"x":-829.88059685396,"y":-20.499471681917,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":-180},{"x":-830.0851503798,"y":19.500005287852,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":-180},{"x":-848.95194214865,"y":-6.5968176672702,"bCoef":0,"cMask":["ball"],"trait":"table","color":"292929"},{"x":-859.95179831533,"y":-6.6530698868752,"bCoef":0,"cMask":["ball"],"trait":"table","color":"292929"},{"x":-849.0133082064,"y":5.4030254236605,"bCoef":0,"cMask":["ball"],"color":"292929"},{"x":-860.01316437308,"y":5.3467732040555,"bCoef":0,"cMask":["ball"],"color":"292929"},{"x":-829.90616604469,"y":-15.499537060696,"bCoef":0,"cMask":["all"],"curve":-180},{"x":-830.05958118907,"y":14.500070666631,"bCoef":0,"cMask":["all"],"curve":-180},{"x":-829.90616604469,"y":-15.499537060696,"bCoef":0,"cMask":["all"],"curve":180},{"x":-830.05958118907,"y":14.500070666631,"bCoef":0,"cMask":["all"],"curve":180},{"x":-829.88059685396,"y":-20.499471681917,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":-180,"color":"e01612"},{"x":-830.0851503798,"y":19.500005287852,"bCoef":-4,"cMask":["ball"],"trait":"basket","curve":-180,"color":"e01612"},{"x":-859.62451267399,"y":-70.652233038505,"bCoef":0.1,"cMask":["red","blue"],"curve":210,"vis":true,"color":"bbbbbb"},{"x":-860.34045001442,"y":69.345936355686,"bCoef":0.1,"cMask":["red","blue"],"curve":210,"vis":true,"color":"bbbbbb"},{"x":-859.62451267399,"y":-70.652233038505,"bCoef":1.15,"cMask":["all"],"trait":"table"},{"x":-865.62443421946,"y":-70.682916067381,"bCoef":1.15,"cMask":["all"],"trait":"table"},{"x":-866.34037155989,"y":69.31525332681,"bCoef":1.15,"cMask":["all"],"trait":"table"},{"x":-860.34045001442,"y":69.345936355686,"bCoef":1.15,"cMask":["all"],"trait":"table"},{"x":-862.63981496116,"y":-67.66761378021,"trait":"table"},{"x":-863.32506927272,"y":66.330634068515,"trait":"table"},{"x":-874.62431653766,"y":-70.728940610694,"bCoef":0.5,"cMask":["ball"],"curve":0},{"x":-864.62444729522,"y":-70.677802229235,"bCoef":0.5,"cMask":["ball"],"curve":0},{"x":-875.34025387808,"y":69.269228783497,"bCoef":0.5,"cMask":["ball"],"curve":0},{"x":-865.34038463564,"y":69.320367164956,"bCoef":0.5,"cMask":["ball"],"curve":0},{"x":-875,"y":-468.75,"bCoef":0,"cMask":["blue"],"trait":"kickOffBarrier"},{"x":-875,"y":468.75,"bCoef":0,"cMask":["blue"],"trait":"kickOffBarrier"},{"x":0,"y":-468.75,"bCoef":0,"cMask":["red","blue"],"trait":"kickOffBarrier"},{"x":0,"y":468.75,"bCoef":0,"cMask":["red","blue"],"trait":"kickOffBarrier","curve":180},{"x":0,"y":-90,"bCoef":0,"cMask":["red"],"cGroup":["blueKO"],"trait":"line"},{"x":0,"y":90,"bCoef":0,"cMask":["red"],"cGroup":["blueKO"],"trait":"line"},{"x":0,"y":503.75,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"trait":"kickOffBarrier"},{"x":0,"y":-503.75,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"trait":"kickOffBarrier"},{"x":0,"y":90,"bCoef":0,"cMask":["red"],"cGroup":["redKO"],"trait":"kickOffBarrier"},{"x":0,"y":-90,"bCoef":0,"cMask":["red"],"cGroup":["redKO"],"trait":"line"},{"x":0,"y":-90,"bCoef":0,"cMask":["blue"],"cGroup":["blueKO"],"trait":"line"},{"x":0,"y":90,"bCoef":0,"cMask":["blue"],"cGroup":["blueKO"],"trait":"line"},{"x":875,"y":168,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"x":603,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":601,"y":-159,"bCoef":0,"trait":"line","curve":0},{"x":875,"y":167,"bCoef":0,"trait":"line"},{"x":874,"y":-158,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":601,"y":-159,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":603,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":601,"y":-159,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":603,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":601,"y":-159,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":603,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":601,"y":-159,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":601,"y":-159,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":875,"y":168,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"x":603,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":603,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":601,"y":-159,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":603,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":601,"y":-159,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":603,"y":161,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","color":"00ffff"},{"x":602,"y":163,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","color":"00ffff"},{"x":603,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":601,"y":-159,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":875,"y":168,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"x":603,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":875,"y":468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":875,"y":-468.75,"bCoef":0,"cMask":["red"],"trait":"kickOffBarrier"},{"x":-597,"y":-159,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":-601,"y":167,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":-597,"y":-160,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":-874,"y":-160,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":-602,"y":166,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"x":-874,"y":167,"bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line","curve":0},{"x":-875,"y":-468.75,"bCoef":0,"cMask":["blue"],"trait":"kickOffBarrier"},{"x":-875,"y":468.75,"bCoef":0,"cMask":["blue"],"trait":"kickOffBarrier"},{"x":604,"y":87,"bCoef":0,"cMask":["wall"],"cGroup":["red","blue","ball"],"trait":"line","vis":true,"color":"FFFFFF","curve":0},{"x":875,"y":86,"bCoef":0,"trait":"line"}],"segments":[{"v0":0,"v1":2,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":2,"v1":1,"curve":-180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":2,"v1":1,"curve":180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":3,"v1":4,"curve":180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":5,"v1":3,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":6,"v1":4,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":7,"v1":8,"curve":180,"vis":true,"bCoef":-4,"cMask":["ball"],"trait":"basket","x":-515},{"v0":9,"v1":10,"curve":-180,"vis":true,"bCoef":-4,"cMask":["ball"],"trait":"basket","x":-515},{"v0":11,"v1":12,"vis":true,"color":"292929","bCoef":0,"cMask":["ball"],"trait":"table","y":-6},{"v0":13,"v1":14,"vis":true,"color":"292929","bCoef":0,"cMask":["ball"],"y":6},{"v0":15,"v1":16,"curve":-180,"vis":true,"color":"ffffff","bCoef":0,"cMask":["all"],"x":-515},{"v0":17,"v1":18,"curve":180,"vis":true,"color":"ffffff","bCoef":0,"cMask":["all"],"x":-515},{"v0":19,"v1":20,"curve":-180,"vis":true,"color":"e01612","bCoef":-4,"cMask":["ball"],"trait":"basket","x":-515},{"v0":21,"v1":22,"curve":210,"vis":true,"color":"bbbbbb","bCoef":0.1,"cMask":["blue"],"x":-515},{"v0":23,"v1":24,"curve":0,"vis":true,"color":"000000","bCoef":1,"cMask":["all"],"trait":"table","y":-70},{"v0":24,"v1":25,"curve":0,"vis":true,"color":"000000","bCoef":1.15,"cMask":["all"],"trait":"table","x":-551},{"v0":25,"v1":26,"curve":0,"vis":true,"color":"000000","bCoef":1,"cMask":["all"],"trait":"table","y":70},{"v0":26,"v1":23,"curve":0,"vis":true,"color":"000000","bCoef":1.15,"cMask":["all"],"trait":"table","x":-545},{"v0":27,"v1":28,"vis":true,"color":"FFFFFF","trait":"table","x":-548},{"v0":29,"v1":30,"curve":0,"vis":false,"bCoef":0.5,"cMask":["ball"]},{"v0":31,"v1":32,"curve":0,"vis":false,"bCoef":0.5,"cMask":["ball"]},{"v0":33,"v1":34,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":33,"v1":35,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red","blue"],"trait":"kickOffBarrier","y":468.75},{"v0":34,"v1":36,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red","blue"],"trait":"kickOffBarrier"},{"v0":37,"v1":38,"curve":-180,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["blue"],"cGroup":["redKO"],"trait":"line"},{"v0":35,"v1":37,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"trait":"kickOffBarrier"},{"v0":40,"v1":42,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":39,"v1":41,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":42,"v1":41,"curve":-180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":42,"v1":41,"curve":180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":43,"v1":44,"curve":180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":45,"v1":43,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":46,"v1":44,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":47,"v1":48,"curve":180,"vis":true,"bCoef":-4,"cMask":["ball"],"trait":"basket","x":-515},{"v0":49,"v1":50,"curve":-180,"vis":true,"bCoef":-4,"cMask":["ball"],"trait":"basket","x":-515},{"v0":51,"v1":52,"vis":true,"color":"292929","bCoef":0,"cMask":["ball"],"trait":"table","y":-6},{"v0":53,"v1":54,"vis":true,"color":"292929","bCoef":0,"cMask":["ball"],"y":6},{"v0":55,"v1":56,"curve":-180,"vis":true,"color":"ffffff","bCoef":0,"cMask":["all"],"x":-515},{"v0":57,"v1":58,"curve":180,"vis":true,"color":"ffffff","bCoef":0,"cMask":["all"],"x":-515},{"v0":59,"v1":60,"curve":-180,"vis":true,"color":"e01612","bCoef":-4,"cMask":["ball"],"trait":"basket","x":-515},{"v0":61,"v1":62,"curve":210,"vis":true,"color":"bbbbbb","bCoef":0.1,"cMask":["red"],"x":-515},{"v0":63,"v1":64,"curve":0,"vis":true,"color":"000000","bCoef":1,"cMask":["all"],"trait":"table","y":-70},{"v0":64,"v1":65,"curve":0,"vis":true,"color":"000000","bCoef":1.15,"cMask":["all"],"trait":"table","x":-551},{"v0":65,"v1":66,"curve":0,"vis":true,"color":"000000","bCoef":1,"cMask":["all"],"trait":"table","y":70},{"v0":66,"v1":63,"curve":0,"vis":true,"color":"000000","bCoef":1.15,"cMask":["all"],"trait":"table","x":-545},{"v0":67,"v1":68,"vis":true,"color":"FFFFFF","trait":"table","x":-548},{"v0":69,"v1":70,"curve":0,"vis":false,"bCoef":0.5,"cMask":["ball"]},{"v0":71,"v1":72,"curve":0,"vis":false,"bCoef":0.5,"cMask":["ball"]},{"v0":73,"v1":74,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["blue"],"trait":"kickOffBarrier","x":875},{"v0":73,"v1":75,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red","blue"],"trait":"kickOffBarrier","y":468.75},{"v0":74,"v1":76,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red","blue"],"trait":"kickOffBarrier"},{"v0":77,"v1":78,"curve":-180,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"cGroup":["blueKO"],"trait":"line"},{"v0":75,"v1":77,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"trait":"kickOffBarrier"},{"v0":76,"v1":79,"curve":0,"vis":false,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"trait":"kickOffBarrier"},{"v0":75,"v1":80,"curve":0,"vis":false,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"trait":"kickOffBarrier"},{"v0":81,"v1":82,"curve":-180,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"cGroup":["redKO"],"trait":"line"},{"v0":83,"v1":84,"curve":-180,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["blue"],"cGroup":["blueKO"],"trait":"line"},{"v0":85,"v1":86,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":86,"v1":87,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"},{"v0":89,"v1":90,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":91,"v1":92,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":93,"v1":94,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":95,"v1":96,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":97,"v1":98,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":99,"v1":100,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":101,"v1":102,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":103,"v1":104,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":105,"v1":106,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":107,"v1":108,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":109,"v1":110,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":111,"v1":112,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":113,"v1":114,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":115,"v1":116,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":117,"v1":118,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":119,"v1":120,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":121,"v1":122,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":123,"v1":124,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":125,"v1":126,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":127,"v1":128,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":129,"v1":130,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":131,"v1":132,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":133,"v1":134,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":135,"v1":136,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":137,"v1":138,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":139,"v1":140,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":141,"v1":142,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":143,"v1":144,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":145,"v1":146,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":147,"v1":148,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":149,"v1":150,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":151,"v1":152,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":153,"v1":154,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":155,"v1":156,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":157,"v1":158,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":160,"v1":161,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":162,"v1":163,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":164,"v1":165,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":166,"v1":167,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":170,"v1":171,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":174,"v1":175,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["red"],"trait":"kickOffBarrier","x":875},{"v0":176,"v1":177,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":178,"v1":179,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":180,"v1":181,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["wall"],"cGroup":["red","ball","blue"],"trait":"line"},{"v0":182,"v1":183,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"cMask":["blue"],"trait":"kickOffBarrier","x":875},{"v0":184,"v1":185,"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line"}],"goals":[{"p0":[814.98317183849,0.11204969857653],"p1":[844.98283592101,0.25401777819235],"team":"blue"},{"p0":[829.91201983994,15.182865779647],"p1":[830.05398791956,-14.816798302878],"team":"blue"},{"p0":[-814.98306975322,-0.42302562484401],"p1":[-844.98267748054,-0.57644076922126],"team":"red"},{"p0":[-829.90616604469,-15.499537060696],"p1":[-830.05958118907,14.500070666631],"team":"red"}],"discs":[],"planes":[{"normal":[1,0],"dist":-875,"bCoef":1.55,"cMask":["ball"],"_data":{"extremes":{"normal":[1,0],"dist":-875,"canvas_rect":[-910,-504,911,504],"a":[-875,-504],"b":[-875,504]}}},{"normal":[-1,0],"dist":-875,"bCoef":1.55,"cMask":["ball"],"_data":{"extremes":{"normal":[-1,0],"dist":-875,"canvas_rect":[-910,-504,911,504],"a":[875,-504],"b":[875,504]}}},{"normal":[0,1],"dist":-468.75,"bCoef":1.55,"cMask":["ball"],"_data":{"extremes":{"normal":[0,1],"dist":-468.75,"canvas_rect":[-910,-504,911,504],"a":[-910,-468.75],"b":[911,-468.75]}}},{"normal":[0,-1],"dist":-468.75,"bCoef":1.55,"cMask":["ball"],"_data":{"extremes":{"normal":[0,-1],"dist":-468.75,"canvas_rect":[-910,-504,911,504],"a":[-910,468.75],"b":[911,468.75]}}},{"normal":[1,0],"dist":-910,"bCoef":0,"cMask":["all"],"_data":{"extremes":{"normal":[1,0],"dist":-910,"canvas_rect":[-910,-504,911,504],"a":[-910,-504],"b":[-910,504]}}},{"normal":[-1,0],"dist":-911,"bCoef":0,"cMask":["all"],"_data":{"extremes":{"normal":[-1,0],"dist":-911,"canvas_rect":[-910,-504,911,504],"a":[911,-504],"b":[911,504]}}},{"normal":[0,1],"dist":-503.75,"bCoef":0,"cMask":["all"],"_data":{"extremes":{"normal":[0,1],"dist":-503.75,"canvas_rect":[-910,-504,911,504],"a":[-910,-503.75],"b":[911,-503.75]}}},{"normal":[0,-1],"dist":-503.75,"bCoef":0,"cMask":["all"],"_data":{"extremes":{"normal":[0,-1],"dist":-503.75,"canvas_rect":[-910,-504,911,504],"a":[-910,503.75],"b":[911,503.75]}}}],"traits":{"ballArea":{"vis":false,"bCoef":1.35,"cMask":["ball"]},"goalPost":{"radius":8,"invMass":0,"bCoef":0.5},"goalNet":{"vis":true,"bCoef":0.1,"cMask":["ball"]},"kickOffBarrier":{"vis":true,"bCoef":0.1,"cGroup":["redKO","blueKO"],"cMask":["red","blue"],"color":"ffffff"},"basket":{"vis":true,"bCoef":-3.3,"cMask":["all"],"color":"e01612"},"table":{"vis":true,"bCoef":1.15,"cMask":["all"],"color":"4f4f4f"},"line":{"vis":true,"bCoef":0,"cMask":[""],"color":"ffffff"}},"ballPhysics":{"color":"CF5A0C","radius":9.85,"bCoef":0.3},"playerPhysics":{"kickStrength":6,"bCoef":1,"acceleration":0.11,"kickingAcceleration":0.083,"kickingDamping":0.96},"canBeStored":false}`
var point = {x:0,y:0};
var lastPlayerTouched = "";
var score = {red:0,blue:0};
var room = HBInit({ roomName: "Basketball x3", noPlayer:true, public:true, maxPlayers: 8, geo});
//Equation of a circle with x (a), y (b) and radius (r): (x-a)² + (y-b)² - r² = 0
//Let's choose a point at anywhere. If the point (here it's the ball position) is inside the circle then (x-a)² + (y-b)² - r² gives negative result, and if outside, then it gives positive result; and else (on the circle), it gives zero.
function GetTwoPointShoot(pos){
return (((-875 < pos.x && pos.x <= -802.5 && -400 < pos.y && pos.y < 400) || (Math.pow((pos.x + 802.5),2) + Math.pow((pos.y - 0),2) - Math.pow(400,2)) < 0)) || ((-400 < pos.y && pos.y < 400 && 802.5 <= pos.x && pos.x < 875) || (Math.pow((pos.x - 802.5),2) + Math.pow((pos.y - 0),2) - Math.pow(400,2)) < 0);
}
function GetThreePointShoot(pos){
return !((((-875 < pos.x && pos.x <= -802.5 && -400 < pos.y && pos.y < 400) || (Math.pow((pos.x + 802.5),2) + Math.pow((pos.y - 0),2) - Math.pow(400,2)) < 0)) || ((-400 < pos.y && pos.y < 400 && 802.5 <= pos.x && pos.x < 875) || (Math.pow((pos.x - 802.5),2) + Math.pow((pos.y - 0),2) - Math.pow(400,2)) < 0));
}
room.onPlayerBallKick = (player) => {
point = room.getBallPosition();
lastPlayerTouched = player;
}
room.onTeamGoal = (team) => {
room.sendAnnouncement("🏀 GOAL! " + lastPlayerTouched.name);
team = lastPlayerTouched.team;
if(team==1){
if(GetTwoPointShoot(point)){
score.red+=2;
}
else if(GetThreePointShoot(point)){
score.red+=3;
}
}
else if(team==2){
if(GetTwoPointShoot(point)){
score.blue+=2;
}
else if(GetThreePointShoot(point)){
score.blue+=3;
}
}
room.sendAnnouncement("🏀 Current Score: 🔴 " + score.red + " - " + score.blue + " 🔵");
}
room.onGameStop = (byPlayer) => {
score = {red:0,blue:0};
point = {x:0,y:0};
lastPlayerTouched = undefined;
}
And here's the output of the above code: https://thehax.pl/forum/powtorki.php?nagranie=0b6168db7a9775099247747e0fce1f6d
By the way, your map has had some small bugs and have fixed them. But anyway, please don't use that much line segments to prevent that the ball to leave the pitch. You can use only one wall with the bias property to make this.
@thenorthstar thanks my friend, i love u.
@thenorthstar First of all, thank you very much. The bot has a problem, when I score a goal against, it announces point for me, not for the opponent.
is it possible to have a command that makes the bot show the score without scoring?
@thenorthstar First of all, thank you very much. The bot has a problem, when I score a goal against, it announces point for me, not for the opponent.
OK. It was solved. I guess you meant it increases the score of wrong team when an own goal is scored. Is that it? OK. It's working correctly now. basketball_x3.txt
is it possible to have a command that makes the bot show the score without scoring?
@Teteule Score will be announced when a player has typed !score in mid-game.
@thenorthstar First of all, thank you very much. The bot has a problem, when I score a goal against, it announces point for me, not for the opponent.
OK. It was solved. I guess you meant it increases the score of wrong team when an own goal is scored. Is that it? OK. It's working correctly now. basketball_x3.txt
is it possible to have a command that makes the bot show the score without scoring?
@Teteule Score will be announced when a player has typed !score in mid-game.
@thenorthstar Thanks, thanks. worked perfectly
@thenorthstar First of all, thank you very much. The bot has a problem, when I score a goal against, it announces point for me, not for the opponent.
OK. It was solved. I guess you meant it increases the score of wrong team when an own goal is scored. Is that it? OK. It's working correctly now. basketball_x3.txt
is it possible to have a command that makes the bot show the score without scoring?
@Teteule Score will be announced when a player has typed !score in mid-game.
@thenorthstar Thanks, thanks. worked perfectly
Oh. It's great. You're welcome. ☺️
hello again @thenorthstar , I was testing the bot and found 2 bugs. 1- When the game starts and I drag the ball and score against without kicking, the server down 2- When Im score dragg the ball to the opponent's basket without kicking, the bot counts as 3 points instead of 2 can you solve this? I'm sorry for giving you so much work :)
hello again @thenorthstar , I was testing the bot and found 2 bugs. 1- When the game starts and I drag the ball and score against without kicking, the server down 2- When Im score dragg the ball to the opponent's basket without kicking, the bot counts as 3 points instead of 2 can you solve this? I'm sorry for giving you so much work :)
@Teteule Yes. It's again my fault. But easy to be solved anyway. Now:
1-) In the previous code, last player touched is just found when someone kicks the ball. This means that dragging of the ball doesn't have any affect on last player touched. So you was getting that error and your server were down.
2-) The same situation triggers this second bug. And now, it has been solved. Here's the new code.
You're free to type again if you find bugs. :)
hello again @thenorthstar , I was testing the bot and found 2 bugs. 1- When the game starts and I drag the ball and score against without kicking, the server down 2- When Im score dragg the ball to the opponent's basket without kicking, the bot counts as 3 points instead of 2 can you solve this? I'm sorry for giving you so much work :)
@Teteule Yes. It's again my fault. But easy to be solved anyway. Now:
1-) In the previous code, last player touched is just found when someone kicks the ball. This means that dragging of the ball doesn't have any affect on last player touched. So you was getting that error and your server were down.
2-) The same situation triggers this second bug. And now, it has been solved. Here's the new code.
You're free to type again if you find bugs. :)
thank you so much again! You help the haxball community a lot.
AYO GUYS! I'm friends with someone who's tryna make a Haxketball league. I coded most of the script, but I'm trying to add a !updatescore function, could someone help?
nvm got it fixed!
When I put the script I get this "Uncaught SyntaxError: Unexpected token ':'" how do I solve it
i need the same script but included in this map https://github.com/haxball/haxball-issues/files/11092702/hul.txt
i need the same script but included in this map https://github.com/haxball/haxball-issues/files/11092702/hul.txt
@lebronormj You can do yourself bro. There's nothing so hard.
@thenorthstar Hello, I am doing my Argentinian basketball league and I have used your map, can you add throw-ins when the ball comes out?
Hii Coders, I need a basketball script. When a team makes a basket, they score two points. If a basket is made outside of the three-point arc, then that basket is worth three points. Basketball Map: botbasquete3.txt