I'm trying to make a simple Torch for a quest for a server, but when I fire the weapon it goes wierd.When you walk, it is and idle gani without the light effect, when its idle, its a walking gani with light.Plz help meh

I INDENT FOR YOU)
NPC Code:
if (weaponfired) {
if (client.torch==0) {
client.torch=1;
timeout=.5;
}
else client.torch=0;
}
if (timeout) {
if (client.torch==1) {
if (strcontains(#m,idle)) {
setani torch_idle,torch2.png;
}
if (strcontains(#m,walk)) {
setani torch_walk,torch2.png;
}
}
timeout=0.05;
}