What's wrong with this code?

I’ve been having any issue with this for the past 2 hours? The PassID and Objects print the same values (they’re both NumberValues) The problem here is that the code won’t get past the 3rd line although it is true?

			local PassID = v:WaitForChild("Configuration"):FindFirstChild("PassID").Value 
                        print(PassID.." "..Object) ---// Prints literally the same values, for example "2..2"
		                if PassID == Object then
                         print("YES THIS WORKS") --// This does not print out
			             v.Visible = true
		                else
                        v.Visible = false
                        end

Is “Object” a part or UI elements? If yes, change line 3 to if PassID == Object.Name then as “PassID” is a StringValue but “Object” is a instance.

If “PassID” is a number (eg 1 2 3), then you should change line 3 to if tostring(PassID) == Object.Name then as comparing a number with a string will get an wrong answer.

1 Like

I wish this was the case, however both values are grabbed from NumberValues and then compared with each other.

Nevermind, turns out the code below had a stringvalue connected to it as well. I got it fixed

2 Likes