Table probplem!

for some reaseon when this function triggers it will teleport the the wrong backpack to the wrong part it teleports the backpack with nill instead teleporting the name to the name can someone please help me with this?

game.ReplicatedStorage.Values.StoryValues.GetBackpacks:GetPropertyChangedSignal("Value"):Connect(function()
	for i,v in pairs(parts) do
		if v.Owner.Value ~= nil then
			local owner = v.Owner.Value
			local partPos = v.CFrame
			for i,v in pairs(backpacks) do
				if v.Owner.Value == owner then
					v.CFrame = partPos
				end
			end
		end
	end
end)
1 Like

I think you didn’t gave the value to pairs(parts)

idk know what you mean with that but it just keeps glitching somethimes 2 backpacks and random parts instead backpack with owner values with teh players name goes to the part with the owner value with the players name