If not (something.Value == "name1" or "name2") do

  1. What do you want to achieve?
    Solution or alternative to checking if a string value is not of 2 different names.

  2. What is the issue?
    Check wont go through, even though an invSlots value is something else. Meaning the 2nd print doesnt show.

Also to keep things clear i have 9 slots, 3 have the value ‘none’ and the other 6 are ‘locked’.

When i activate another script it does change the first slot with a value of none to the name seen in the print, then it fires a remote event to the script that activates the function.
(So i know the problem is located in the code i selected).

image
(From print(invSlot.Value)

Im 99.9% sure the problem is in
“if not (invSlot.Value == “none” or “locked”) then”

  1. What solutions have you tried so far?
    I did look through devforum of the different ways in have to check if a value is 1 of 2 names and it does work but in this sense it doesnt.
function updateSpace()
	task.wait(0.1)
	
	for _, invSlot in pairs(invSpace:GetChildren()) do
		print(invSlot.Value)

		if not (invSlot.Value == "none" or "locked") then
			print("not none or locked")
			if not itemsFrame:FindFirstChild(invSlot.Value) then

			end	

		end

	end

end

Sorry if this isnt enough to figure the problem, just ask for more and ill provide.

1 Like

You can’t just set up an if statement like that.

Code:

function updateSpace()
	task.wait(0.1)

	for _, invSlot in pairs(invSpace:GetChildren()) do
		print(invSlot.Value)

		if not (invSlot.Value == "none" or invSlot.Value == "locked") then
			print("not none or locked")
			if not itemsFrame:FindFirstChild(invSlot.Value) then

			end	
		end
	end
end

You can also use:

if value ~= otherValue then

To check if it’s inequal.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.