BoneTown – Script to Change Player Speed Using a Keyboard Key

Sample Script Code: Bind a Key to a Function to Change The Player Speed

Note: Credit goes to Codeman02Fr

So you copy this code and put it in a bonetown/game/mods/myfirstscript.cs

//declare our global variable to store the speed, it will increase each time you press  the keys
$myplayerspeed = "3";

// then our function to be called :
function changeplayerspeed()
{
	%tChar = ServerConnection.GameCharacter; //get the player object from engine
		if(%tChar !$= "" && %tChar !$= "0") //ensure the mission and player object are loaded !!!
		{  
			%tChar.modifySpeed($myplayerspeed, 1);  // set to speed to 4 or more ,change the value to test XD

                       $myplayerspeed++;  // this allow to auto increase the value each time the function is called by pressing the keys
		}
}



// this will call the function when you press CTRL + J  keys ingame
GlobalActionMap.bind(keyboard, "ctrl j", "changeplayerspeed", "Description: change the player speed to 4"); 

Once you load the game and you are in a mission, press CTRL + J keys and it will make you player faster than before, don’t go too far or you will be like “the Flash” hahaha.

Helena Stamatina
About Helena Stamatina 3203 Articles
I love two things in life, games and sports. Although sports were my earliest interest, it was video games that got me completely addicted (in a good way). My first game was Crash Bandicoot (PS1) from the legendary studio Naughty Dog back in 1996. I turned my passion for gaming into a job back in 2019 when I transformed my geek blog (Re-actor) into the gaming website it is today.

Be the first to comment

Leave a Reply

Your email address will not be published.


*