| [SIMPLE] Variables 
 
				Ok, so I'm having a little trouble with some variable-scripts, that I haven't tried before. It looks like this:
 void WoodCreakStart(string &in asParent, string &in asChild, int alState)
 {
 AddTimer("WoodCreakStart", 5, "WoodCreak");
 }
 
 void WoodCreak(string &in asTimer)
 {
 if(asTimer == "WoodCreakStart")
 {
 StartScreenShake(0.03f, 5.0f, 2.0f, 2.0f);
 PlaySoundAtEntity("Creak", "00_creak.snt", "Player", 2.0f, false);
 AddTimer("Creak_1", 0.5f, "WoodCreak");
 }
 
 if(asTimer == "Creak_1")
 {
 if(GetLocalVarInt("CreakVar") < 7)
 {
 CreateParticleSystemAtEntity("CreakDust_"+CreakVar, "ps_dust_drilling.ps", "WoodCreakParticle_"+CreakVar, false);
 AddLocalVarInt("CreakVar", 1);
 AddTimer("Creak_1", 0.1f, "WoodCreak");
 }
 }
 }
 
 Simply, what happens is that when I enter the area, dust should be drilling from each 6 areas once.
 But it should happen like this:
 Dust from area1
 Wait 0.1 seconds
 Dust from area2
 Wait 0.1 seconds
 
 and so on
 
 This is where i have the trouble:
 
 if(asTimer == "Creak_1")
 {
 if(GetLocalVarInt("CreakVar") < 7)
 {
 CreateParticleSystemAtEntity("CreakDust_"+CreakVar, "ps_dust_drilling.ps", "WoodCreakParticle_"+CreakVar, false);
 AddLocalVarInt("CreakVar", 1);
 AddTimer("Creak_1", 0.1f, "WoodCreak");
 }
 }
 
 It says CreakVar is not declared... but should it be, when i use it like +CreakVar?
 
 Trying is the first step to success. |