I'm trying to make it where if you're in the air and looking down, a fireball projectile is shot in the way you are looking but it seems that the script just skips over the :GetState() if statement part and goes to the mouse.Hit.lookVector...

elseif char.Humanoid:GetState() == Enum.HumanoidStateType.Freefall or char.Humanoid:GetState() == Enum.HumanoidStateType.Jumping and mouse.Hit.lookVector.y <= 0 then
					y.Velocity = mouse.Hit.lookVector*110
			y.MaxForce = Vector3.new(1e8,1e8,1e8)
			local jump = script.JumpExplodeScript:Clone()
			jump.Parent = Fireball2
			fd.Disabled = true
			jump.Disabled = false

another instance where it hasn't worked for me was here...

if humanoid:GetState() ~= Enum.HumanoidStateType.Freefall or humanoid:GetState() ~= Enum.HumanoidStateType.Jumping then
game.Debris:AddItem(character.LeftFoot.supertrail1,0)
game.Debris:AddItem(character.RightFoot.supertrail2,0)
script.On.Value = false
humanoid.JumpPower = 67
   character.Humanoid.WalkSpeed = origSpeed
    end
end
end

2 comments

0

Logical operators have an order of precedence. The and keyword runs before the or keyword, so if I have: , Lua will read it as <if a or (b and c)>.

0

So put brackets around your two GetState() statements that are being or'd together.