Why the [redacted] aren't these variables equalling eachother?

I found some weird glitch I’m sick and tired of already, because it doesn’t make sense. I am making a system where when you level up, you get an item. The script checks the ID of the reward and sifts through the ID’s of all items until it finds the reward item. This technically works as shown here:

local itemID = reward.Reward.Value
				for i, v in pairs(game.ReplicatedStorage.Items.Rewards[itemType]:GetChildren()) do
					for index, item in pairs(v:GetChildren()) do
						print(item.ID.Value)
						print(itemID)
						if item.ID.Value == itemID then
							print("les gooo")

When it finds the reward item, both item.ID.Value and itemID are printed in the debug 5. So clearly the if statement should be true right? 5 equals 5!!!

But no, les gooo never prints. I have no idea why. I do not know what I am doing wrong. I feel like I have failed my friends, my family. Why does item.ID.Value ~= itemID when it does!?

Someone help. This is annoying.

Maybe one of them is a string and the other is a number?

2 Likes

Perhaps they are different types? (Like one is a string and one is a number) but I don’t really know

1 Like

I recommend changing the name of your topic. It doesn’t feel right and its not professional.

1 Like

wrong person ______________________________

1 Like

From now on I have no intent on calling myself an “advanced scripter”, after this I clearly do not deserve that title. Thank you for the obvious point out, you too @sir_vitamin.

also don’t worry because we all make little mistakes like these lol

1 Like

Haha, true. I’m just surprised I let that possibility slip my mind for this long now.

That wasn’t the title I was looking for.

I believe it is in our best interest to find a comforting compromise that expressed my dramatic concern while humbling to your professional etiquette of no cursing.

thank you very much. I appreciate your “concern”. I believe this is getting off topic. I suggest that we should just get to the point.

1 Like