Attempt to index nil with Parent

Im trying to make a script that finds a item from replicated storage and gets its rarity (its Parent) but for some reaosn it does not work with the rare and Epic raritys? Here is a picture of the explorer tab:

image

Here is the script that is getting the Error. and btw it is on the lie 4,

			local unboxableItems = crateProperties["Items"]
			table.sort(unboxableItems, function(a, b)
				return 

			
	
					(rarityProperties[items:FindFirstChild(a, true).Parent.Name].Order.Value < rarityProperties[items:FindFirstChild(b, true).Parent.Name].Order.Value)
						or 
						
							rarityProperties[items:FindFirstChild(a, true).Parent.Name].Order.Value == rarityProperties[items:FindFirstChild(b, true).Parent.Name].Order.Value
							and 
							(a < b)

And if you want to know how I got [“Items”], here is the script:

local properties = {}



properties["Items"] = {
	"Bluesteel", "Cheetah", "Frost", "Noob", "Poker","Radioactive","Rainbow","Sparkletime","Stained",
	"Magma", "Origon", "Transparent",

	"Cyberunk"
}

properties["Chances"] = {
	Common = 60;
	Uncommon = 30;

	Legendary = 2;
}

properties["Price"] = 0

properties["Image"] = "rbxassetid://79934763818940"



return properties
1 Like

Please fix this part, its unreadable :sob:

2 Likes

I figured it out, my spelling was off from the Modual script and the actual item :sob:

2 Likes

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