
 My (Quite) Simple Script Won't Work.
I can't get these two simple scripts to work. The error they give is confusing, it says "then" expected near "=" on line 9/8
 The first is attached to an emitter called "Smasher Grenade Shot Active Tracer" It is created first.
Code:
function Create(self)
SmashDist = 60
print("A")
end
function Update(self)
   for particle in MovableMan.Particles do
      if particle.PresetName = ("Smasher Grenade Shot Active") then
         local Twin = particle
      end
      
      if MovableMan:IsParticle("Twin") then
         for actor in MovableMan.Actors do
            if (self.Pos - actor.Pos).Magnitude < SmashDist then
               print("ActorDetected A")
            end
         end
         if (self.Pos - particle.Pos).Magnitude < SmashDist and particle.PresetName ~= "Smasher Grenade Shot Active" and particle.PresetName ~= "Smasher Grenade Shot Active Tracer" then
            print("ParticleDetected A")
         end
      else
         print("NoTwin")
      end
   end
end 
The second is created a random amount of time later. It is another AEmitter that is called "Smasher Grenade Shot Active"
Code:
function Create(self)
print("B")
end
function Update(self)
   for particle in MovableMan.Particles do
      if particle.PresetName = ("Smasher Grenade Shot Active Tracer") then
         local Twin = particle
      end
      
      if MovableMan:IsParticle("Twin") then
         for actor in MovableMan.Actors do
            if (self.Pos - actor.Pos).Magnitude < SmashDist then
               print("ActorDetected B")
            end
         end
         if (self.Pos - particle.Pos).Magnitude < SmashDist and particle.PresetName ~= "Smasher Grenade Shot Active" and particle.PresetName ~= "Smasher Grenade Shot Active Tracer" then
            print("ParticleDetected B")
         end
      else
         print("NoTwin")
      end
   end
end