View Single Post
  #1  
Old 12-13-2012, 09:40 PM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
Triggering Variables in other Weapons

I am making a custom attack system and I swear I tested this before and it worked.

On my Movement 'weapon' I set a variable --- canmove = 1;
Pretty much this checks to see if the player is allowed to move

On my Attack 'weapon' the "canmove" is set to 0. Works

THEN I have a ScheduleEvent function that sets the 'canmove' to 1 again...but it doesn't set.

PHP Code:
//MOVEMENT SNIPPET
//#CLIENTSIDE
function onCreated()
{
 
canatk = 1;
 
canmove = 1;
 
canjump = 1;
 
disabledefmovement();
 
onTimeOut();
} 
PHP Code:
//TEST WEAPON TO SET VARIABLES
//#CLIENTSIDE
function onKeyPressed(code, key)
{
 if (
key == "v")
 {
  
setAni("sword", NULL);
  
canmove = 0;
  
scheduleEvent(1, "onUnfreeze");
  }
  }
  
function 
onUnfreeze(){
player.chat = "unfreeze";
client.canmove = 1;
} 
Like I said, it will set it to 0, but wont return it to 1
Reply With Quote