ZfsrGhS953 / Petridish-Ogar

Want to make an agario clone that'll have lots of custom modes, good physics and won't lag like hell? Petridish Ogar is for you!
7 stars 4 forks source link

how to #6

Open RelTakeover opened 8 years ago

RelTakeover commented 8 years ago

how to CREATE A COMMANDS called playermassdecayrate like command 'speed' on ogarul

to modify massdecayrate of a specific player plz help me

module.exports = function (gameServer, split) { var id = parseInt(split[1]); var speed = parseInt(split[2]); if (isNaN(id)) { console.log("[Console] Please specify a valid player ID!"); return; } if (isNaN(speed)) { console.log("[Console] Please specify a valid speed!"); return; }

for (var i in gameServer.clients) { if (gameServer.clients[i].playerTracker.pID == id) { var client = gameServer.clients[i].playerTracker;

  client.customspeed = speed;

}

} console.log("[Console] Player " + id + "'s base speed is now " + speed); };