I've run into a problem where I'm trying to create a rank lock. I do not want them accessing all the morphs only the designated ones I've designed for them. The problem is, that nowhere online does it show this question. There was a similar question but didn't give much detail. I've tried to use this local script. But no such luck. Help a brother out.

local Allowed = true

				if v3:FindFirstChild("Rank") then
					if Player:GetRankInGroup(Divisions[i].GroupId) >= v3:FindFirstChild("Rank").Value then
						Allowed = true
					else
						Allowed = false
					end
				end
			  if Allowed then
				local Button2 = Instance.new("TextButton")
	            Button2.Size = UDim2.new(1,0,0,50)
	            Button2.BackgroundTransparency = 1
	            Button2.Font = "SourceSans"
	            Button2.TextSize = 30
	            Button2.TextXAlignment = "Left"
	            Button2.TextColor3 = Color3.fromRGB(255,255,255)
			
		
	
	            Button2.Text = v3.Name
	            Button2.Parent = UniformsFrame
	
	            Button2.MouseButton1Click:connect(function ()
		
		
	                RemoveObjects()
	
					if v3:FindFirstChild("Leg1") then
						GiveHelmet(v3.Leg1, "Left Leg")
					end
					if v3:FindFirstChild("Leg2") then
						GiveHelmet(v3.Leg2, "Right Leg")
					end
					if v3:FindFirstChild("Arm1") then
						GiveHelmet(v3.Arm1, "Left Arm")
					end
					if v3:FindFirstChild("Arm2") then
						GiveHelmet(v3.Arm2, "Right Arm")
					end
					if v3:FindFirstChild("Chest") then
						GiveHelmet(v3.Chest, "Torso")
					end
					if v3:FindFirstChild("Helmet") then
						GiveHelmet(v3.Helmet, "Head")
					end
					SelectedMorph = v3
					
					script.Parent.Parent.Spawn.Visible = true
	            end)
			end
	        end
	    end)
	end
end	

end