Roblox ignoring the "and" in my script?

I have this dialogue gui script that once youve done a job, or if you haven’t, it will give you a gui dialogue depending on what youve done, but even if you have not done the job, its giving the one where you have? Any help, heres part of the script, and also, no output errors.

if 
	Player.Backpack:FindFirstChild("Broom") or 
	Character:FindFirstChild("Broom") and 
	game.Workspace:WaitForChild("FootClean1").Part2:FindFirstChild("Decal").Transparency == 0.9 and 
	game.Workspace:WaitForChild("FootClean2").Part2:FindFirstChild("Decal").Transparency == 0.9 and 
	game.Workspace:WaitForChild("FootClean3").Part2:FindFirstChild("Decal").Transparency == 0.9 
then

	script.Parent.Response1.Visible = true
	script.Parent.Response2JobAdditionSucess.Visible = true
	print("FINISHED")

else
	if 
		Player.Backpack:FindFirstChild("Broom") or 
		Character:FindFirstChild("Broom") and 
		game.Workspace:WaitForChild("FootClean1").Part2.Decal.Transparency == 0.9 and 
		game.Workspace.FootClean2.Part2.Decal.Transparency == 0 and 
		game.Workspace.FootClean3.Part2.Decal.Transparency == 0 
	then

		script.Parent.Response1.Visible = true
		script.Parent.Response2JobAddition.Visible = true
		print("Not Finished")
	else
		if 
			Player.Backpack:FindFirstChild("Broom") or 
			Character:FindFirstChild("Broom") and
			game.Workspace:WaitForChild("FootClean1").Part2.Decal.Transparency == 0.9 and 
			game.Workspace.FootClean2.Part2.Decal.Transparency == 0.9 and 
			game.Workspace.FootClean3.Part2.Decal.Transparency == 0 
		then

			script.Parent.Response1.Visible = true
			script.Parent.Response2JobAddition.Visible = true
			print("Not Finished")

		else
			if 
				Player.Backpack:FindFirstChild("Broom") or 
				Character:FindFirstChild("Broom") and 
				game.Workspace:WaitForChild("FootClean1").Part2.Decal.Transparency == 0 and 
				game.Workspace.FootClean2.Part2.Decal.Transparency == 0.9 and 
				game.Workspace.FootClean3.Part2.Decal.Transparency == 0.9 
			then

				script.Parent.Response1.Visible = true
				script.Parent.Response2JobAddition.Visible = true
				print("Not Finished")

			else

				if 
					Player.Backpack:FindFirstChild("Broom") or 
					Character:FindFirstChild("Broom") and 
					game.Workspace:WaitForChild("FootClean1").Part2.Decal.Transparency == 0 and 
					game.Workspace.FootClean2.Part2.Decal.Transparency == 0 and 
					game.Workspace.FootClean3.Part2.Decal.Transparency == 0 
				then

					script.Parent.Response1.Visible = true
					script.Parent.Response2JobAddition.Visible = true
					print("Not Finished")

				else
					if 
						Player.Backpack:FindFirstChild("Broom") or 
						Character:FindFirstChild("Broom") and 
						game.Workspace:WaitForChild("FootClean1").Part2.Decal.Transparency == 0 and 
						game.Workspace.FootClean2.Part2.Decal.Transparency == 0 and 
						game.Workspace.FootClean3.Part2.Decal.Transparency == 0.9 
					then

						script.Parent.Response1.Visible = true
						script.Parent.Response2JobAddition.Visible = true
						print("Not Finished")
					else
						if 
							not Player.Backpack:FindFirstChild("Broom") or 
							Character:FindFirstChild("Broom") 
						then

							script.Parent.Response1.Visible = true
							script.Parent.Response2.Visible = true
							print("Not Started")
end
end
end
end
end
end
end

Reverse the order of the and. Simple as that.

statement and value or value

Alright ill test that out. Thank you.

Put this in brackets. It’s evaluating to “if the broom is in the backpack OR the broom is in the character and feet are clean”. Group it so it evaluates to “if the broom is in the backpack or the character AND feet are clean”.

The or operator separates your operands and your and operator adds them. They’re incorrectly evaluating here.

Alright thank you, I will do this.

So I did both of your suggestions, and it works, until you get to the “Im finished” because even though your finished, it doesn’t show the Response2JobAdditionSucess

Does your first statement print out the ‘FINISHED’? If so then try making sure you can initially see the Response2JobAdditionSuccess. Otherwise it might be that the Decal Transparency condition you’re looking for hasn’t been met.

From the looks of it, Decal Transparency looks like it’s getting some floating point problems, try rounding the value.

image

Basically have something, like a function to round the transparency value

function rd(num)
return math.floor(num*10^1+0.5)/10^1 -- round to nearest decimal
end
...
if game.Workspace:WaitForChild("FootClean3").Part2:FindFirstChild("Decal").Transparency == rd(0.9) then
-- do code

Ill try to see what I can do this with, but I am confused a lil bit.

for complex comparisons I always but brackets () round the items that relate so I would have put them round the or pair and round the and triplet so it looks like if a and b where a contains the ors and b contains the ands.