Help negating an if argument
A few days ago, I posted on this forum asking for a way to check if an actor was using a specific weapon. Now my problem is exactly the opposite: I want to check if that actor is NOT using that said weapon. Here's the code I'm using: (not all of it)
Code:
if self:IsPlayerControlled() and UInputMan:KeyPressed(24) then
for mo in MovableMan.Particles do
for i = 1, MovableMan:GetMOIDCount() - 1 do
mo = MovableMan:GetMOFromID(i)
if mo.RootID == self.ID and mo.PresetName == "Red's Saw" then
if self.dashtimer1:IsPastRealMS(800) == true then
self:GetController():SetState(Controller.BODY_CROUCH,true);
self:GetController():SetState(Controller.WEAPON_FIRE,true);
dash = CreateMOPixel("Dash Holder Pixel");
local sigma = ToActor(self):GetAimAngle(true);
dash.Pos = self.Pos + Vector(math.cos(sigma)*300,math.sin(sigma)*-300);
flashpoint = CreateAEmitter("Shiny Yellow Blast Long");
flashpoint.Pos = self.Pos;
self.Vel.X = (self.Pos.X - dash.Pos.X) * -0.06;
self.Vel.Y = (self.Pos.Y - dash.Pos.Y) * -0.06;
MovableMan:AddParticle(flashpoint);
flashpoint.Vel.X = (flashpoint.Pos.X - dash.Pos.X) * -0.06;
flashpoint.Vel.Y = (flashpoint.Pos.Y - dash.Pos.Y) * -0.06;
MovableMan:AddParticle(dash);
self:ClearForces(); -- This is here to prevent actors from instagibbing after a couple of dashes.
self.invictimer:Reset();
self.HitsMOs = false;
self.GetsHitByMOs = false;
self.dashtimer1:Reset();
end
-- else
-- if self.dashtimer1:IsPastRealMS(800) == true then
-- self:GetController():SetState(Controller.BODY_CROUCH,true);
-- dash = CreateMOPixel("Dash Holder Pixel");
-- local sigma = ToActor(self):GetAimAngle(true);
-- dash.Pos = self.Pos + Vector(math.cos(sigma)*300,math.sin(sigma)*-300);
-- self.Vel.X = (self.Pos.X - dash.Pos.X) * -0.06;
-- self.Vel.Y = (self.Pos.Y - dash.Pos.Y) * -0.06;
-- MovableMan:AddParticle(dash);
-- self:ClearForces(); -- This is here to prevent actors from instagibbing after a couple of dashes.
-- for soondeadguy in MovableMan.Actors do
-- soondeadguy:SetWhichMOToNotHit(self,0.6);
-- end
-- self.dashtimer1:Reset();
-- end
end
end
end
end
The commented out part is what I wanted to happen if the key was pressed and the actor wasn't holding the weapon. Before anyone asks, the else statement doesn't work, as it causes the second option to happen always, regardless of the weapon being held or not. Can anyone help with this?