keybind

Started by MEGAMIND, Jun 09, 2018, 12:58 PM

Previous topic - Next topic

MEGAMIND

how can we stop a key binding in a specific world?

MEGAMIND

#1
function onKeyDown(player,key)
{
if(player.World == 13){
I <- BindKey(true, 0x49, 0, 0);
}
}
this way..?

so true will execute in world 13 if false so it wont execute right?

so i have about 13 worlds so shall i do this to every world except world 1?
will it work?

i treid but in world one then bindkey i doesnot work
if(player.World == 13){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 12){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 11){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 10){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 9){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 8){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 7){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 6){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 5){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 4){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 3){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 2){
I <- BindKey(false, 0x49, 0, 0);
}
if(player.World == 1){
I <- BindKey(true, 0x49, 0, 0);
}

NicusorN5

No. Inside the function OnKeyUp() or OnKeyDown.
function OnKeyDown(player,key)
{
   if(key == I ) //I should be created in event OnScriptLoad()
  {
    if(player.World == 13) //make our key only work for this world
    {
      //key actions
     }
  }
}