BoneTown: Como alterar a velocidade do player usando uma tecla do teclado com script

Aqui está um tutorial simples sobre como alterar a velocidade do jogador usando uma tecla do teclado.

 

Como alterar a velocidade do player usando uma tecla do teclado com script

então você copia este código e coloca em um 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");

depois de carregar o jogo e estiver em uma missão, pressione as teclas CTRL + J e isso fará com que você jogue mais rápido do que antes.

By Codeman02Fr

Deixe um comentário

ArabicEnglishFrenchGermanItalianJapaneseKoreanPortugueseSpanish